did_url_parser/
lib.rs

1//! # did
2//!
3//! An implementation of [DID Identifiers](https://www.w3.org/TR/did-core/#identifier) for the [Rust](https://www.rust-lang.org/) programming language.
4//!
5//! ### References
6//!
7//! - [DID Core](https://www.w3.org/TR/did-core/)
8//!
9#![no_std]
10
11#[cfg(not(feature = "alloc"))]
12compile_error!("This crate does not yet support environments without liballoc.");
13
14#[cfg(feature = "alloc")]
15extern crate alloc;
16#[cfg(feature = "std")]
17extern crate std;
18
19#[cfg(feature = "serde")]
20#[macro_use]
21extern crate serde;
22
23mod core;
24mod did;
25mod error;
26mod input;
27
28pub use self::did::DID;
29pub use self::error::Error;
30pub use self::error::Result;
31
32/// A helper macro to assist with the construction of [`DID`]s.
33#[macro_export]
34macro_rules! did {
35  ($did:expr) => {
36    $crate::DID::parse($did).unwrap()
37  };
38}