pub struct Options { /* private fields */ }Expand description
Ordered map of loader options.
Implementations§
Source§impl Options
impl Options
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
true if key is present.
Sourcepub fn get(&self, key: &str) -> Option<&OptionValue>
pub fn get(&self, key: &str) -> Option<&OptionValue>
The value for key, or None if absent.
Sourcepub fn get_mut(&mut self, key: &str) -> Option<&mut OptionValue>
pub fn get_mut(&mut self, key: &str) -> Option<&mut OptionValue>
A mutable reference to the value for key, or None if absent.
Sourcepub fn insert<K: Into<String>, V: Into<OptionValue>>(
&mut self,
key: K,
value: V,
) -> Option<OptionValue>
pub fn insert<K: Into<String>, V: Into<OptionValue>>( &mut self, key: K, value: V, ) -> Option<OptionValue>
Insert key = value, returning the previous value if key was already present.
A duplicate key replaces the earlier entry, matching the “last wins” rule for parsed source strings.
Sourcepub fn remove(&mut self, key: &str) -> Option<OptionValue>
pub fn remove(&mut self, key: &str) -> Option<OptionValue>
Remove and return the value for key, or None if absent.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &OptionValue)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &OptionValue)>
Iterate over (key, value) pairs in insertion order.
Sourcepub fn values(&self) -> impl Iterator<Item = &OptionValue>
pub fn values(&self) -> impl Iterator<Item = &OptionValue>
Iterate over values in insertion order.
Trait Implementations§
Source§impl From<Options> for OptionValue
impl From<Options> for OptionValue
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
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