Skip to content

Commit 0c921b9

Browse files
committed
fix(did_parser): Add readme and simple example (openwallet-foundation#1047)
1 parent fee4076 commit 0c921b9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

did_parser/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# did_parser
2+
3+
A crate for parsing DIDs and DID URLs.
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use did_parser::{Did, DidUrl};
2+
3+
fn main() {
4+
// parse a string into DID
5+
Did::parse("did:web:w3c-ccg.github.io".into()).expect("should correctly parse did");
6+
7+
// parse a string into DID URL
8+
DidUrl::parse("did:example:123456789abcdefghi;param=value?query=value".into())
9+
.expect("should correctly parse did url");
10+
}

0 commit comments

Comments
 (0)