pub struct Ntfs { /* private fields */ }
Expand description
Root structure describing an NTFS filesystem.
Implementations§
source§impl Ntfs
impl Ntfs
sourcepub fn new<T>(fs: &mut T) -> Result<Self>where
T: Read + Seek,
pub fn new<T>(fs: &mut T) -> Result<Self>where T: Read + Seek,
Creates a new Ntfs
object from a reader and validates its boot sector information.
The reader must cover the entire NTFS partition, not more and not less. It will be rewinded to the beginning before reading anything.
sourcepub fn cluster_size(&self) -> u32
pub fn cluster_size(&self) -> u32
Returns the size of a single cluster, in bytes.
sourcepub fn file<'n, T>(
&'n self,
fs: &mut T,
file_record_number: u64
) -> Result<NtfsFile<'n>>where
T: Read + Seek,
pub fn file<'n, T>( &'n self, fs: &mut T, file_record_number: u64 ) -> Result<NtfsFile<'n>>where T: Read + Seek,
Returns the NtfsFile
for the given NTFS File Record Number.
The first few NTFS files have fixed indexes and contain filesystem
management information (see the KnownNtfsFileRecordNumber
enum).
sourcepub fn file_record_size(&self) -> u32
pub fn file_record_size(&self) -> u32
Returns the size of a File Record of this NTFS filesystem, in bytes.
sourcepub fn mft_position(&self) -> NtfsPosition
pub fn mft_position(&self) -> NtfsPosition
Returns the absolute byte position of the Master File Table (MFT).
This NtfsPosition
is guaranteed to be nonzero.
sourcepub fn read_upcase_table<T>(&mut self, fs: &mut T) -> Result<()>where
T: Read + Seek,
pub fn read_upcase_table<T>(&mut self, fs: &mut T) -> Result<()>where T: Read + Seek,
Reads the $UpCase file from the filesystem and stores it in this Ntfs
object.
This function only needs to be called if case-insensitive comparisons are later performed (i.e. finding files).
sourcepub fn root_directory<'n, T>(&'n self, fs: &mut T) -> Result<NtfsFile<'n>>where
T: Read + Seek,
pub fn root_directory<'n, T>(&'n self, fs: &mut T) -> Result<NtfsFile<'n>>where T: Read + Seek,
Returns the root directory of this NTFS volume as an NtfsFile
.
sourcepub fn sector_size(&self) -> u16
pub fn sector_size(&self) -> u16
Returns the size of a single sector in bytes.
sourcepub fn serial_number(&self) -> u64
pub fn serial_number(&self) -> u64
Returns the 64-bit serial number of this NTFS volume.
sourcepub fn volume_info<T>(&self, fs: &mut T) -> Result<NtfsVolumeInformation>where
T: Read + Seek,
pub fn volume_info<T>(&self, fs: &mut T) -> Result<NtfsVolumeInformation>where T: Read + Seek,
Returns an NtfsVolumeInformation
containing general information about
the volume, like the NTFS version.
sourcepub fn volume_name<T>(&self, fs: &mut T) -> Option<Result<NtfsVolumeName>>where
T: Read + Seek,
pub fn volume_name<T>(&self, fs: &mut T) -> Option<Result<NtfsVolumeName>>where T: Read + Seek,
Returns an NtfsVolumeName
to read the volume name (also called volume label)
of this NTFS volume.
Note that a volume may also have no label, which is why the return value is further
encapsulated in an Option
.