[−][src]Struct uefi::proto::media::file::NamedFileProtocolInfo
Dynamically sized FileProtocolInfo
with a header and an UCS-2 name
All structs that can currently be queried via Get/SetInfo can be described as a (possibly empty) header followed by a variable-sized name.
Since such dynamic-sized types are a bit unpleasant to handle in Rust today, this generic struct was created to deduplicate the relevant code.
The reason why this struct covers the whole DST, as opposed to the
[Char16]
part only, is that pointers to DSTs are created in a rather
unintuitive way that is best kept centralized in one place.
Implementations
impl NamedFileProtocolInfo<FileInfoHeader>
[src]
pub fn new<'buf>(
storage: &'buf mut [u8],
file_size: u64,
physical_size: u64,
create_time: Time,
last_access_time: Time,
modification_time: Time,
attribute: FileAttribute,
file_name: &str
) -> Result<&'buf mut Self, FileInfoCreationError>
[src]
storage: &'buf mut [u8],
file_size: u64,
physical_size: u64,
create_time: Time,
last_access_time: Time,
modification_time: Time,
attribute: FileAttribute,
file_name: &str
) -> Result<&'buf mut Self, FileInfoCreationError>
Create a FileInfo
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 version of the 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.
pub fn file_size(&self) -> u64
[src]
File size (number of bytes stored in the file)
pub fn physical_size(&self) -> u64
[src]
Physical space consumed by the file on the file system volume
pub fn create_time(&self) -> &Time
[src]
Time when the file was created
pub fn last_access_time(&self) -> &Time
[src]
Time when the file was last accessed
pub fn modification_time(&self) -> &Time
[src]
Time when the file's contents were last modified
pub fn attribute(&self) -> FileAttribute
[src]
Attribute bits for the file
pub fn file_name(&self) -> &CStr16
[src]
Name of the file
impl NamedFileProtocolInfo<FileSystemInfoHeader>
[src]
pub fn new<'buf>(
storage: &'buf mut [u8],
read_only: bool,
volume_size: u64,
free_space: u64,
block_size: u32,
volume_label: &str
) -> Result<&'buf mut Self, FileInfoCreationError>
[src]
storage: &'buf mut [u8],
read_only: bool,
volume_size: u64,
free_space: u64,
block_size: u32,
volume_label: &str
) -> 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 version of the 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.
pub fn read_only(&self) -> bool
[src]
Truth that the volume only supports read access
pub fn volume_size(&self) -> u64
[src]
Number of bytes managed by the file system
pub fn free_space(&self) -> u64
[src]
Number of available bytes for use by the file system
pub fn block_size(&self) -> u32
[src]
Nominal block size by which files are typically grown
pub fn volume_label(&self) -> &CStr16
[src]
Volume label
impl NamedFileProtocolInfo<FileSystemVolumeLabelHeader>
[src]
pub fn new<'buf>(
storage: &'buf mut [u8],
volume_label: &str
) -> Result<&'buf mut Self, FileInfoCreationError>
[src]
storage: &'buf mut [u8],
volume_label: &str
) -> Result<&'buf mut Self, FileInfoCreationError>
Create a FileSystemVolumeLabel
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 version of the 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.
pub fn volume_label(&self) -> &CStr16
[src]
Volume label
Trait Implementations
impl<Header> Align for NamedFileProtocolInfo<Header>
[src]
pub fn alignment() -> usize
[src]
pub fn assert_aligned(storage: &mut [u8])
[src]
impl<Header: Debug> Debug for NamedFileProtocolInfo<Header>
[src]
impl<Header> FromUefi for NamedFileProtocolInfo<Header>
[src]
Auto Trait Implementations
impl<Header> Send for NamedFileProtocolInfo<Header> where
Header: Send,
Header: Send,
impl<Header> Sync for NamedFileProtocolInfo<Header> where
Header: Sync,
Header: Sync,
impl<Header> Unpin for NamedFileProtocolInfo<Header> where
Header: Unpin,
Header: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,