1 unstable release

0.1.0 Nov 13, 2020

#1528 in Parser implementations

Download history 893/week @ 2023-12-13 704/week @ 2023-12-20 210/week @ 2023-12-27 814/week @ 2024-01-03 730/week @ 2024-01-10 641/week @ 2024-01-17 624/week @ 2024-01-24 795/week @ 2024-01-31 2495/week @ 2024-02-07 3592/week @ 2024-02-14 5143/week @ 2024-02-21 3504/week @ 2024-02-28 4241/week @ 2024-03-06 2310/week @ 2024-03-13 2611/week @ 2024-03-20 1814/week @ 2024-03-27

11,592 downloads per month
Used in 11 crates (2 directly)

MIT/Apache

29KB
732 lines

did

A parser for Decentralized Identifiers (DIDs)


use did_url::DID;

let did = DID::parse("did:example:alice")?;

// Prints Method = example
println!("Method = {}", did.method());

// Prints Method Id = alice
println!("Method Id = {}", did.method_id());

// Prints DID = did:example:alice
println!("DID = {}", did);

// Prints Joined = did:example:alice?query=true#key-1
println!("Joined = {}", did.join("#key-1")?.join("?query=true")?);

References


License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~200KB