mousetrap 0.1.0

Detect starting from Windows explorer in Rust
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented0 out of 1 items with examples
  • Size
  • Source code size: 8.63 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • iyear/mousetrap-rs
    4 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • iyear

mousetrap-rs

Rust implementation of https://github.com/inconshreveable/mousetrap

mousetrap is a tiny library that answers a single question.

On a Windows machine, was the process invoked by someone double-clicking on the executable file while browsing in explorer?

mousetrap provides a way to detect these invocations so that you can provide more helpful behavior and instructions on how to run the CLI tool.

On non-Windows platforms, this library always returns false.

Installation

Add this to your Cargo.toml:

[dependencies]
mousetrap = "0.1"

Usage

use std::io;

fn main() {
    println!("started_by_explorer: {}", mousetrap::started_by_explorer());

    println!("Press Enter to exit...");

    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
}

License

MIT