pub struct File(/* private fields */);Expand description
A null-terminated string that always maps to the 128 bytes assigned to it in Message.
You can get the string value back out with to_string():
let path: CString = file.to_string();Implementations§
Source§impl File
impl File
Sourcepub const EMPTY: Self
pub const EMPTY: Self
A File that contains all zero bytes.
This is more performant than File::new(c"")
Sourcepub fn new(path: &CStr) -> Result<Self>
pub fn new(path: &CStr) -> Result<Self>
Construct a valid file field.
path must not be more than 128 bytes.
The last byte of which must be 0x00 (null-terminated).
Sourcepub fn from_slice_unchecked(path: &[u8]) -> Self
pub fn from_slice_unchecked(path: &[u8]) -> Self
Converts an array slice of exactly 128 byte length into a File without performing any checks (such as length or null-termination).
Panics if slice is not 128 bytes.
Useful if you are handling the return of parse_file.
Sourcepub fn from_array(name: [u8; 128]) -> Self
pub fn from_array(name: [u8; 128]) -> Self
Create a File by passing the inner type directly.
Trait Implementations§
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more