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 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
Trait Implementations§
Source§impl Clone for MountParams
impl Clone for MountParams
Source§fn clone(&self) -> MountParams
fn clone(&self) -> MountParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MountParams
impl Debug for MountParams
Source§impl Default for MountParams
impl Default for MountParams
Source§fn default() -> MountParams
fn default() -> MountParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MountParams
impl RefUnwindSafe for MountParams
impl Send for MountParams
impl Sync for MountParams
impl Unpin 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
Mutably borrows from an owned value. Read more
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<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
Converts the given service transport handle of type
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>
Converts
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>
Converts
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 moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.