Struct winparsingtools::structs::shell_items::ShellItem[][src]

pub struct ShellItem {
    pub size: u16,
    pub class_type: u8,
    pub shell_item_data: Option<ShellItemTypes>,
}

ShellItem is struct that reads the struct bytes and decide which shellitem struct to use (FileEntryShellItem, VolumeShellItem, etc).

Fields

size: u16

Shell item size in bytes.

class_type: u8

Shell item type (FileEntry, Volume, Root, etc)

shell_item_data: Option<ShellItemTypes>

The parsed shell item data

Implementations

impl ShellItem[src]

pub fn from_buffer(buf: &[u8]) -> Result<Self>[src]

Returns a ShellItem from a slice.

Examples

use winparsingtools::structs::shell_items::ShellItem;
fn main (){
    // a buffer that contains the shell item data
    let shell_item_data: &[u8] = &[
       0x5A, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x51, 0x79, 0x62, 0x20, 0x00, 0x74, 0x65,
       0x73, 0x74, 0x2E, 0x74, 0x78, 0x74, 0x00, 0x00, 0x42, 0x00, 0x09, 0x00, 0x04, 0x00, 0xEF, 0xBE,
       0x85, 0x51, 0x79, 0x62, 0x85, 0x51, 0x79, 0x62, 0x2E, 0x00, 0x00, 0x00, 0x26, 0x74, 0x02, 0x00,
       0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
       0x00, 0x00, 0x39, 0xD2, 0x1B, 0x01, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x2E, 0x00,
       0x74, 0x00, 0x78, 0x00, 0x74, 0x00, 0x00, 0x00, 0x18, 0x00 
   ];
   println!("{:?}\n",ShellItem::from_buffer(&shell_item_data).unwrap());
}

pub fn from_reader<R: Read + Seek>(r: &mut R) -> Result<Self>[src]

Returns a ShellItem from an instence that implements Read and Seek.

Examples

// Open a file (std::fs::File implements `Read` and `Seek` traits) then pass it to the function
// to parse the shell item data
let mut shell_item_data = File::open("shell_item_data.bin")?;
println!("{:?}\n",ShellItem::from_reader(&mut shell_item_data).unwrap());

Trait Implementations

impl Debug for ShellItem[src]

impl Serialize for ShellItem[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.