A crate for building and parsing Matrix URIs according to both the matrix.to specification and also MSC2312 (matrix://
).
Optionally provides conversion to types from ruma_identifiers
with the ruma
feature
```rust let uri = crate::MatrixUri::new( crate::MatrixId::new(crate::IdType::UserId, String::from("cute:some.url")), None, None, Some(vec![String::from("headpat.services"), String::from("cute.local")]), Some(crate::MatrixUriAction::Chat), ) .unwrap();
println!("{} with {}", uri.action().unwrap().tostring(), uri.mxid.tostring()); // chat with @cute:some.url
println!("{}", uri.matrixuristring()); // matrix:u/cute%3Asome.url?action=chat&via=headpat.services&via=cute.local
println!("{}", uri.matrixtostring()); // https://matrix.to/#/%40cute%3Asome.url?action=chat&via=headpat.services&via=cute.local
```
```rust let uri = matrixuri::MatrixUri::fromstr("matrix:u/her:example.org?action=chat").unwrap();
println!("{} - {:?}", uri.mxid.to_string(), uri.action().unwrap()); // @her:example.org - Chat
```
Can be viewed from source by running cargo doc --open