Crate netrc_util

source ·
Expand description

§netrc_util

A simple libary for parsing netrc files.

§Usage

use netrc_util::{Host, NetrcParser};

let netrc_content = "machine sample.test login user password pass";
let host = Host::parse("sample.test").unwrap();

let entry = NetrcParser::new(netrc_content.as_bytes())
    .entry_for_host(&host)
    .unwrap()
    .unwrap();

assert_eq!(entry.login(), Some("user".to_string()).as_ref());
assert_eq!(entry.password(), "pass");

Re-exports§

Modules§

Enums§

  • The host name of an URL.