Skip to main content

Ext4Reader

Struct Ext4Reader 

Source
pub struct Ext4Reader<T: Seek + Read> {
    pub fs: BufReader<T>,
    pub blocksize: u16,
    pub offset_start: u64,
    /* private fields */
}
Expand description

Create a reader that can parse the ext4 filesystem

Fields§

§fs: BufReader<T>§blocksize: u16

Default is probably 4096

§offset_start: u64

Will be 0. Unless you are reading a disk image file like QCOW or VMDK

Implementations§

Source§

impl<T: Seek + Read> Ext4Reader<T>

Source

pub fn new( fs: BufReader<T>, blocksize: u16, offset_start: u64, ) -> Result<Ext4Reader<T>, Ext4Error>

Initialize an ext4 filesystem reader. This reader will automatically set the correct blocksize if you do not know it

Trait Implementations§

Source§

impl<'ext4, 'reader, T: Seek + Read> Ext4ReaderAction<'ext4, 'reader, T> for Ext4Reader<T>

Source§

fn root(&mut self) -> Result<FileInfo, Ext4Error>

Return file info about the root directory. Can be used to start a file listing
Source§

fn read_dir(&mut self, inode: u32) -> Result<FileInfo, Ext4Error>

Read a directory based on provided inode value
Source§

fn superblock(&mut self) -> Result<SuperBlock, Ext4Error>

Return the SuperBlock information for the ext4 filesystem
Source§

fn stat(&mut self, inode: u32) -> Result<Stat, Ext4Error>

Stat a file
Source§

fn hash( &mut self, inode: u32, hashes: &Ext4Hash, ) -> Result<HashValue, Ext4Error>

Hash a file. MD5, SHA1, SHA256 are supported
Source§

fn read(&mut self, inode: u32) -> Result<Vec<u8>, Ext4Error>

Read the contents of a file into memory. WARNING this will read the entire file regardless of size into memory!
Source§

fn reader( &'reader mut self, inode: u32, ) -> Result<FileReader<'reader, T>, Ext4Error>

Create a reader to stream a file from the ext4 filesystem.
Source§

fn descriptors(&mut self) -> Result<Vec<Descriptor>, Ext4Error>

Return descriptors for the ext4 filesystem
Source§

fn extents(&mut self, inode: u32) -> Result<Option<Extents>, Ext4Error>

Return extents for a provide inode
Source§

fn inode_verbose(&mut self, inode: u32) -> Result<Inode, Ext4Error>

Return verbose inode information for the provided inode

Auto Trait Implementations§

§

impl<T> Freeze for Ext4Reader<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Ext4Reader<T>
where T: RefUnwindSafe,

§

impl<T> Send for Ext4Reader<T>
where T: Send,

§

impl<T> Sync for Ext4Reader<T>
where T: Sync,

§

impl<T> Unpin for Ext4Reader<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Ext4Reader<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Ext4Reader<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.