pub struct MountParams { /* private fields */ }Expand description
Parses a comma-separated list of options of the form key or key=value or key="value".
Commas and equals-signs are only permitted in the key="value" case. In the case of
key=value1,key=value2 collisions, the last value wins. Returns a hashmap of key/value pairs,
or EINVAL in the case of malformed input. Note that no escape character sequence is supported,
so values may not contain the " character.
§Examples
key0=value0,key1,key2=value2,key0=value3 -> map{"key0":"value3","key1":"","key2":"value2"}
key0=value0,key1="quoted,with=punc:tua-tion." ->
map{"key0":"value0","key1":"quoted,with=punc:tua-tion."}
key0="mis"quoted,key2=unquoted -> EINVAL
Implementations§
Source§impl MountParams
impl MountParams
pub fn parse(data: &FsStr) -> Result<Self, Errno>
pub fn keys(&self) -> impl Iterator<Item = &FlyByteStr>
pub fn get(&self, key: &[u8]) -> Option<&FlyByteStr>
pub fn get_as<T: FromStr>(&self, key: &[u8]) -> Result<Option<T>, Errno>
pub fn get_with<T, E: Debug>( &self, key: &[u8], parser: impl FnOnce(&str) -> Result<T, E>, ) -> Result<Option<T>, Errno>
pub fn remove(&mut self, key: &[u8]) -> Option<FlyByteStr>
pub fn is_empty(&self) -> bool
pub fn remove_mount_flags(&mut self) -> MountFlags
Sourcepub fn format_options(&self) -> FsString
pub fn format_options(&self) -> FsString
Formats the mount parameters as comma-separated key[=value] pairs, with each option
preceded by a leading comma (e.g. ,gid=3009,hidepid=2). The order is unspecified.
Trait Implementations§
Source§impl Clone for MountParams
impl Clone for MountParams
Source§impl Debug for MountParams
impl Debug for MountParams
Source§impl Default for MountParams
impl Default for MountParams
Auto Trait Implementations§
impl Freeze for MountParams
impl RefUnwindSafe for MountParams
impl Send for MountParams
impl Sync for MountParams
impl Unpin for MountParams
impl UnsafeUnpin for MountParams
impl UnwindSafe for MountParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more