pub enum Value<'a> {
Address(u64),
Format(Format),
Id(u64),
Size(u64),
String(&'a str),
}Expand description
A parsed command argument value.
Instances of Value represent concrete arguments that were parsed from
user input according to the expected Type for a command parameter.
Variants§
Address(u64)
Parsed address value.
Format(Format)
A format specifier value.
Id(u64)
Numeric identifier.
Size(u64)
Numeric size.
String(&'a str)
A borrowed string slice.
Implementations§
Source§impl<'a> Value<'a>
impl<'a> Value<'a>
Sourcepub fn new(param_type: &Type, param: &'a str) -> Result<Self>
pub fn new(param_type: &Type, param: &'a str) -> Result<Self>
Parse a parameter string into a typed Value according to param_type.
§Arguments
param_type- The expectedTypedescribing how to parseparam.param- The raw string slice containing the parameter to parse.
§Errors
Returns an Err if the parameter cannot be parsed according to
param_type (for example an invalid hex address or non-numeric id).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Value<'a>
impl<'a> RefUnwindSafe for Value<'a>
impl<'a> Send for Value<'a>
impl<'a> Sync for Value<'a>
impl<'a> Unpin for Value<'a>
impl<'a> UnsafeUnpin for Value<'a>
impl<'a> UnwindSafe for Value<'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