#[repr(C)]pub struct FileSystemInfo { /* private fields */ }
Expand description
System volume information
May only be obtained on the root directory’s file handle.
Please note that only the system volume’s volume label may be set using
this information structure. Consider using FileSystemVolumeLabel
instead.
Implementations
sourceimpl FileSystemInfo
impl FileSystemInfo
sourcepub fn new<'buf>(
storage: &'buf mut [u8],
read_only: bool,
volume_size: u64,
free_space: u64,
block_size: u32,
volume_label: &CStr16
) -> Result<&'buf mut Self, FileInfoCreationError>
pub fn new<'buf>(
storage: &'buf mut [u8],
read_only: bool,
volume_size: u64,
free_space: u64,
block_size: u32,
volume_label: &CStr16
) -> Result<&'buf mut Self, FileInfoCreationError>
Create a FileSystemInfo
structure
The structure will be created in-place within the provided storage
buffer. The buffer must be large enough to hold the data structure,
including a null-terminated UCS-2 name
string.
The buffer must be correctly aligned. You can query the required
alignment using the alignment()
method of the Align
trait that this
struct implements.
sourcepub fn volume_size(&self) -> u64
pub fn volume_size(&self) -> u64
Number of bytes managed by the file system
sourcepub fn free_space(&self) -> u64
pub fn free_space(&self) -> u64
Number of available bytes for use by the file system
sourcepub fn block_size(&self) -> u32
pub fn block_size(&self) -> u32
Nominal block size by which files are typically grown
sourcepub fn volume_label(&self) -> &CStr16
pub fn volume_label(&self) -> &CStr16
Volume label
Trait Implementations
sourceimpl Align for FileSystemInfo
impl Align for FileSystemInfo
sourcefn offset_up_to_alignment(val: usize) -> usize
fn offset_up_to_alignment(val: usize) -> usize
Calculate the offset from val
necessary to make it aligned,
rounding up. For example, if val
is 1 and the alignment is 8,
this will return 7. Returns 0 if val == 0
. Read more
sourcefn round_up_to_alignment(val: usize) -> usize
fn round_up_to_alignment(val: usize) -> usize
Round val
up so that it is aligned.
sourcefn align_buf(buf: &mut [u8]) -> Option<&mut [u8]>
fn align_buf(buf: &mut [u8]) -> Option<&mut [u8]>
Get a subslice of buf
where the address of the first element
is aligned. Returns None
if no element of the buffer is
aligned. Read more
sourcefn assert_aligned(storage: &mut [u8])
fn assert_aligned(storage: &mut [u8])
Assert that some storage is correctly aligned for this type