Crates.io | did_url_parser |
lib.rs | did_url_parser |
version | 0.2.0 |
source | src |
created_at | 2024-03-26 16:39:52.125377 |
updated_at | 2024-03-26 16:39:52.125377 |
description | A no_std parser for Decentralized Identifiers (DIDs) |
homepage | |
repository | https://github.com/iotaledger/did_url |
max_upload_size | |
id | 1186705 |
size | 51,900 |
A parser for Decentralized Identifiers (DIDs)
A fork of l1h3r/did_url.
use did_url_parser::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")?);