Struct libprefetch::Prefetch [] [src]

pub struct Prefetch { /* fields omitted */ }

A Prefetch file reader and parser.

Basic Example

use libprefetch::Prefetch;


let file = std::fs::File::open("assets/WUAUCLT.EXE-399A8E72.pf").unwrap();

let prefetch = Prefetch::new(file).unwrap();

// Or with a path

let prefetch =
     Prefetch::from_path("assets/WUAUCLT.EXE-399A8E72.pf").unwrap();

Methods

impl Prefetch
[src]

[src]

Returns the version of the Prefetch file.

[src]

Returns the size of the Prefetch file.

[src]

Returns the name of the executable.

[src]

Returns the prefetch hash of the executable.

[src]

Returns the last execution time, in FILETIME format

[src]

Returns the execution counter (how many times the exe was run).

[src]

Returns an Iterator for file metrics.

Example

use libprefetch::Prefetch;

let prefetch =
    Prefetch::from_path("assets/WUAUCLT.EXE-399A8E72.pf").unwrap();

// Iterate over metrics
for metric in prefetch.metrics().unwrap() {
    println!("Loaded file by the exe: {}", metric.filename());
}

[src]

Returns an Iterator for the trace chains.

Example

use libprefetch::Prefetch;

let prefetch =
    Prefetch::from_path("assets/WUAUCLT.EXE-399A8E72.pf").unwrap();

// Iterate over the chain
for item in prefetch.trace().unwrap() {
    println!("Trace #{}, bytes loaded:: {}", item.id(), item.load_count());
}

[src]

Returns an Iterator for the volumes.

Example

use libprefetch::Prefetch;

let prefetch =
    Prefetch::from_path("assets/WUAUCLT.EXE-399A8E72.pf").unwrap();

// Iterates over the volumes
println!(" ===== Volumes ===== ");
for volume in prefetch.volumes().unwrap() {
  println!("Volume #{}:", volume.id());
  println!("    Path: {}", volume.device_path());
  println!("    Creation time: {}", volume.creation_time());
  println!("    Serial number: {}", volume.serial_number());
  println!("    Directories: ");
  for directory in volume.directories().unwrap() {
    println!("        {}", directory);
  }
}

[src]

Constructs a new Prefetch from a std::io::Read source.

Example

use libprefetch::Prefetch;

let file = std::fs::File::open("assets/WUAUCLT.EXE-399A8E72.pf").unwrap();

let prefetch = Prefetch::new(file).unwrap();

[src]

Constructs a new Prefetch from a file path.

Example

use libprefetch::Prefetch;

let prefetch
     = Prefetch::from_path("assets/WUAUCLT.EXE-399A8E72.pf").unwrap();

Trait Implementations

Auto Trait Implementations

impl !Send for Prefetch

impl !Sync for Prefetch