pub enum Version {
V3,
V4,
}
Expand description
The CFB format version to use.
Variants§
Implementations§
Source§impl Version
impl Version
Sourcepub fn from_number(number: u16) -> Option<Version>
pub fn from_number(number: u16) -> Option<Version>
Returns the version enum for the given version number, or None
.
Sourcepub fn sector_shift(self) -> u16
pub fn sector_shift(self) -> u16
Returns the sector shift used in this version.
Sourcepub fn sector_len(self) -> usize
pub fn sector_len(self) -> usize
Returns the length of sectors used in this version.
use cfb::Version;
assert_eq!(Version::V3.sector_len(), 512);
assert_eq!(Version::V4.sector_len(), 4096);
Sourcepub fn stream_len_mask(self) -> u64
pub fn stream_len_mask(self) -> u64
Returns the bitmask used for reading stream lengths in this version.
Sourcepub fn dir_entries_per_sector(self) -> usize
pub fn dir_entries_per_sector(self) -> usize
Returns the number of directory entries per sector in this version.
Trait Implementations§
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Copy for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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