pub struct OptItem { /* private fields */ }Expand description
A single mount option item, consisting of a name and an optional value.
§Examples
let item = OptItem::flag("ro").unwrap();
assert_eq!(item.name(), "ro");
assert!(item.value().is_none());
let item = OptItem::new("size", Some("10G".into())).unwrap();
assert_eq!(item.value(), Some("10G"));Implementations§
Source§impl OptItem
impl OptItem
Sourcepub fn new(
name: impl Into<String>,
value: Option<String>,
) -> Result<Self, OptItemError>
pub fn new( name: impl Into<String>, value: Option<String>, ) -> Result<Self, OptItemError>
Create a new option item with an optional value.
§Errors
Returns OptItemError::EmptyName if the name is empty.
Sourcepub fn class(&self) -> Option<OptionClass>
pub fn class(&self) -> Option<OptionClass>
The classification of this option (VFS, filesystem, or userspace).
Returns None for unknown options.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OptItem
impl<'de> Deserialize<'de> for OptItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for OptItem
impl StructuralPartialEq for OptItem
Auto Trait Implementations§
impl Freeze for OptItem
impl RefUnwindSafe for OptItem
impl Send for OptItem
impl Sync for OptItem
impl Unpin for OptItem
impl UnsafeUnpin for OptItem
impl UnwindSafe for OptItem
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