1 unstable release

0.1.0 Nov 13, 2020

#1869 in Parser implementations

Download history 419/week @ 2024-07-23 581/week @ 2024-07-30 633/week @ 2024-08-06 448/week @ 2024-08-13 432/week @ 2024-08-20 310/week @ 2024-08-27 127/week @ 2024-09-03 303/week @ 2024-09-10 296/week @ 2024-09-17 253/week @ 2024-09-24 200/week @ 2024-10-01 205/week @ 2024-10-08 268/week @ 2024-10-15 171/week @ 2024-10-22 421/week @ 2024-10-29 376/week @ 2024-11-05

1,284 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

~190KB