[][src]Struct parselnk::Lnk

pub struct Lnk {
    pub header: ShellLinkHeader,
    pub string_data: StringData,
    pub link_target_id_list: LinkTargetIdList,
    pub link_info: LinkInfo,
    pub extra_data: ExtraData,
    // some fields omitted
}

Represents a windows .lnk file

Fields

header: ShellLinkHeader

The ShellLinkHeader structure contains identification information, timestamps, and flags that specify the presence of optional structures, including LinkTargetIDList (section 2.2), LinkInfo (section 2.3), and StringData (section 2.4).

string_data: StringData

StringData refers to a set of structures that convey user interface and path identification information. The presence of these optional structures is controlled by LinkFlags (section 2.1.1) in the ShellLinkHeader (section 2.1).

link_target_id_list: LinkTargetIdList

The LinkTargetIDList structure specifies the target of the link. The presence of this optional structure is specified by the HasLinkTargetIDList bit (LinkFlags section 2.1.1) in the ShellLinkHeader (section 2.1).

link_info: LinkInfo

The LinkInfo structure specifies information necessary to resolve a link target if it is not found in its original location. This includes information about the volume that the target was stored on, the mapped drive letter, and a Universal Naming Convention (UNC) form of the path if one existed when the link was created. For more details about UNC paths, see [MS-DFSNM] section 2.2.1.4.:w

extra_data: ExtraData

ExtraData refers to a set of structures that convey additional information about a link target. These optional structures can be present in an extra data section that is appended to the basic Shell Link Binary File Format.

Methods

impl Lnk[src]

pub fn new<S: Read>(reader: &mut S) -> Result<Lnk>[src]

Creates a new Lnk from a Read source.

Example

use parselnk::Lnk;
use std::fs::File;

let mut file = File::open(r"c:\users\me\desktop\firefox.lnk").unwrap();
let lnk = Lnk::new(&mut file);

pub fn arguments(&self) -> Option<String>[src]

The command line arguments supplied via the Lnk

pub fn relative_path(&self) -> Option<PathBuf>[src]

The relative path to the resource of the `Lnk``

pub fn working_dir(&self) -> Option<PathBuf>[src]

The working directory of the Lnk

pub fn description(&self) -> Option<String>[src]

The description of the Lnk

pub fn creation_time(&self) -> u64[src]

The creation FileTime as a u64

pub fn access_time(&self) -> u64[src]

The access FileTime as a u64

pub fn write_time(&self) -> u64[src]

The write FileTime as a u64

pub fn created_on(&self) -> Option<DateTime<Utc>>[src]

The creation FileTime as a DateTime

pub fn accessed_on(&self) -> Option<DateTime<Utc>>[src]

The access FileTime as a DateTime

pub fn modified_on(&self) -> Option<DateTime<Utc>>[src]

The write FileTime as a DateTime

Trait Implementations

impl Clone for Lnk[src]

impl Debug for Lnk[src]

impl<'_> TryFrom<&'_ [u8]> for Lnk[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ Path> for Lnk[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ Vec<u8>> for Lnk[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Vec<u8>> for Lnk[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Lnk

impl Send for Lnk

impl Sync for Lnk

impl Unpin for Lnk

impl UnwindSafe for Lnk

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.