pub struct Size(/* private fields */);Expand description
Size of a device, partition, etc.
Implementations§
Source§impl Size
impl Size
Sourcepub fn value(&self) -> &UnsignedInt
pub fn value(&self) -> &UnsignedInt
Returns the Size value.
Sourcepub fn into_unsigned_int(self) -> UnsignedInt
pub fn into_unsigned_int(self) -> UnsignedInt
Consumes this Size, and returns its underlying UnsignedInt value.
Sourcepub fn from_str_u64(s: &str) -> Result<Size, ParserError>
pub fn from_str_u64(s: &str) -> Result<Size, ParserError>
Parses a Size from a UTF-8 str representing a 64-bit integer.
Sourcepub fn from_str_u32(s: &str) -> Result<Size, ParserError>
pub fn from_str_u32(s: &str) -> Result<Size, ParserError>
Parses a Size from a UTF-8 str representing a 32-bit integer.
Sourcepub fn try_from_u64<T>(bytes: T) -> Result<Size, ConversionError>
pub fn try_from_u64<T>(bytes: T) -> Result<Size, ConversionError>
Converts a byte string to a 64-bit Size. The byte string contains a string
representation of an integer.
Sourcepub fn try_from_u32<T>(bytes: T) -> Result<Size, ConversionError>
pub fn try_from_u32<T>(bytes: T) -> Result<Size, ConversionError>
Converts a byte string to a 32-bit Size. The byte string contains a string
representation of an integer.
Trait Implementations§
Source§impl AsRef<UnsignedInt> for Size
impl AsRef<UnsignedInt> for Size
Source§fn as_ref(&self) -> &UnsignedInt
fn as_ref(&self) -> &UnsignedInt
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl From<UnsignedInt> for Size
impl From<UnsignedInt> for Size
Source§fn from(num: UnsignedInt) -> Size
fn from(num: UnsignedInt) -> Size
Converts to this type from the input type.
Source§impl Ord for Size
impl Ord for Size
Source§impl PartialOrd for Size
impl PartialOrd for Size
impl Eq for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl Freeze for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnwindSafe for Size
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