pub struct VirtualFileEncoder {
pub file_header: FileHeader,
pub file_footer: VirtualFileFooter,
pub vfm: Option<VirtualFileMap>,
/* private fields */
}Expand description
Encodes the a virtual file.
Fields§
§file_header: FileHeaderThe appropriate FileHeader.
The appropriate VirtualFileFooter.
vfm: Option<VirtualFileMap>The resolved virtual file map for regular virtual files, in case of a virtual regular file.
Implementations§
Source§impl VirtualFileEncoder
impl VirtualFileEncoder
Sourcepub fn new(
file_header: FileHeader,
file_footer: VirtualFileFooter,
vfm: Option<VirtualFileMap>,
encryption_information: Option<EncryptionInformation>,
) -> Self
pub fn new( file_header: FileHeader, file_footer: VirtualFileFooter, vfm: Option<VirtualFileMap>, encryption_information: Option<EncryptionInformation>, ) -> Self
Creates a new VirtualFileEncoder from the header, footer, optional
virtual file map, and optional encryption information.
Sourcepub fn file_header_ref(&self) -> &FileHeader
pub fn file_header_ref(&self) -> &FileHeader
Returns a reference of the appropriate file header
Sourcepub fn encoded_header(&self) -> Result<Vec<u8>>
pub fn encoded_header(&self) -> Result<Vec<u8>>
Returns the encoded FileHeader.
§Error
Returns an error if the file header is encrypted and the encryption fails.
Sourcepub fn encoded_vfm(&self) -> Result<Option<Vec<u8>>>
pub fn encoded_vfm(&self) -> Result<Option<Vec<u8>>>
Returns the encoded VirtualFileMap, if this virtual file has one.
§Error
Returns an error if encoding the virtual file map with the configured encryption settings fails.
Returns the appropriate encoded VirtualFileFooter.
§Error
Returns an error if the file footer is encrypted and the encryption fails.
Trait Implementations§
Source§impl Drop for VirtualFileEncoder
impl Drop for VirtualFileEncoder
Auto Trait Implementations§
impl Freeze for VirtualFileEncoder
impl RefUnwindSafe for VirtualFileEncoder
impl Send for VirtualFileEncoder
impl Sync for VirtualFileEncoder
impl Unpin for VirtualFileEncoder
impl UnsafeUnpin for VirtualFileEncoder
impl UnwindSafe for VirtualFileEncoder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more