Crates.io | did_url |
lib.rs | did_url |
version | 0.1.0 |
source | src |
created_at | 2020-11-13 01:57:41.904298 |
updated_at | 2020-11-13 01:57:41.904298 |
description | A no_std parser for Decentralized Identifiers (DIDs) |
homepage | |
repository | https://github.com/l1h3r/did_url |
max_upload_size | |
id | 311808 |
size | 49,539 |
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")?);