pub struct Label(/* private fields */);
Expand description
Filesystem label.
The label is at most 16 bytes, and may contain null bytes. The encoding is not specified.
Implementations§
Source§impl Label
impl Label
Sourcepub fn to_str(&self) -> Result<&str, Utf8Error>
pub fn to_str(&self) -> Result<&str, Utf8Error>
Convert the label to a UTF-8 string, if possible.
The first null byte, and any following bytes, are excluded from the conversion.
Sourcepub const fn as_bytes(&self) -> &[u8; 16]
pub const fn as_bytes(&self) -> &[u8; 16]
Get the raw bytes of the label. This may include null bytes.
Sourcepub fn display(&self) -> BytesDisplay<'_>
pub fn display(&self) -> BytesDisplay<'_>
Get an object that implements Display
to allow conveniently
printing labels that may or may not be valid UTF-8. Non-UTF-8
characters will be replaced with ‘�’.
Null bytes are not included.
Trait Implementations§
Source§impl Ord for Label
impl Ord for Label
Source§impl PartialOrd for Label
impl PartialOrd for Label
impl Copy for Label
impl Eq for Label
impl StructuralPartialEq for Label
Auto Trait Implementations§
impl Freeze for Label
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnwindSafe for Label
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