Struct winparsingtools::structs::shell_items::ShellItem [−][src]
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
Auto Trait Implementations
impl RefUnwindSafe for ShellItem
[src]
impl Send for ShellItem
[src]
impl Sync for ShellItem
[src]
impl Unpin for ShellItem
[src]
impl UnwindSafe for ShellItem
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,