pub struct Options<'a>(/* private fields */);Expand description
The options of a function or markup, in source order.
Duplicates are representable, so that validation can report Duplicate Option Name; a valid message has none.
Implementations§
Source§impl<'a> Options<'a>
impl<'a> Options<'a>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
No options, with room for capacity without reallocating.
Sourcepub fn push(&mut self, name: Cow<'a, str>, value: OptionValue<'a>)
pub fn push(&mut self, name: Cow<'a, str>, value: OptionValue<'a>)
Appends an option (duplicates are kept).
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &OptionValue<'a>)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &OptionValue<'a>)>
(identifier, value) pairs, in source order.
Sourcepub fn get(&self, name: &str) -> Option<&OptionValue<'a>>
pub fn get(&self, name: &str) -> Option<&OptionValue<'a>>
The value of the first option named exactly name.
Sourcepub fn into_owned(self) -> Options<'static>
pub fn into_owned(self) -> Options<'static>
The same options, owned.
Trait Implementations§
impl<'a> Eq for Options<'a>
Source§impl<'a> FromIterator<(Cow<'a, str>, OptionValue<'a>)> for Options<'a>
impl<'a> FromIterator<(Cow<'a, str>, OptionValue<'a>)> for Options<'a>
Source§fn from_iter<I: IntoIterator<Item = (Cow<'a, str>, OptionValue<'a>)>>(
iter: I,
) -> Self
fn from_iter<I: IntoIterator<Item = (Cow<'a, str>, OptionValue<'a>)>>( iter: I, ) -> Self
Creates a value from an iterator. Read more
impl<'a> StructuralPartialEq for Options<'a>
Auto Trait Implementations§
impl<'a> Freeze for Options<'a>
impl<'a> RefUnwindSafe for Options<'a>
impl<'a> Send for Options<'a>
impl<'a> Sync for Options<'a>
impl<'a> Unpin for Options<'a>
impl<'a> UnsafeUnpin for Options<'a>
impl<'a> UnwindSafe for Options<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more