pub enum ClearableValue {
Single(Option<String>),
Array(Option<Vec<String>>),
}Expand description
Represents a potentially cleared or overridden value.
This type is used for values in package sections where values from a pkgbase section might
be cleared or overridden.
Variants§
Implementations§
Source§impl ClearableValue
impl ClearableValue
Sourcefn single_till_newline(input: &mut &str) -> ModalResult<Self>
fn single_till_newline(input: &mut &str) -> ModalResult<Self>
Recognizes a ClearableValue::Single while handling the surroundings.
Cleared values are represented by non-existing values.
Consumes leading and trailing spaces while also consuming newlines.
Also allows variables at the end of the file where no newline is found.
Calls Value::parse_next_value for variable parsing.
§Errors
Returns an error if no ClearableValue::Single is found in input.
Sourcefn list_till_newline(input: &mut &str) -> ModalResult<Self>
fn list_till_newline(input: &mut &str) -> ModalResult<Self>
Recognizes a ClearableValue::Array while handling the surroundings.
Cleared values are represented by the non-existance of a value.
Consumes leading and trailing spaces while also consuming newlines.
Also allows variables at the end of the file where no newline is found.
Calls Value::parse_next_value for variable parsing.
§Errors
Returns an error if no ClearableValue::Array is found in input.
Trait Implementations§
Source§impl Clone for ClearableValue
impl Clone for ClearableValue
Source§fn clone(&self) -> ClearableValue
fn clone(&self) -> ClearableValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more