mirror of
https://git.asonix.dog/asonix/activitystreams.git
synced 2024-11-22 03:40:59 +00:00
Add URL functions to kinds lib
This commit is contained in:
parent
8f5badad06
commit
dff8fbbe59
2 changed files with 20 additions and 0 deletions
|
@ -13,6 +13,7 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
url = "2"
|
||||
|
||||
[dev-dependencies]
|
||||
anyhow = "1"
|
||||
|
|
|
@ -2,6 +2,25 @@
|
|||
//!
|
||||
//! Enums representing typed versions of activitypub 'type' fields.
|
||||
|
||||
use url::Url;
|
||||
|
||||
/// Returns the `https://www.w3.org/ns/activitystreams` Url
|
||||
pub fn context() -> Url {
|
||||
"https://www.w3.org/ns/activitystreams".parse().unwrap()
|
||||
}
|
||||
|
||||
/// Returns the `https://www.w3.org/ns/activitystreams#Public` Url
|
||||
pub fn public() -> Url {
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
.parse()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
/// Returns the `https://w3id.org/security/v1` Url
|
||||
pub fn security() -> Url {
|
||||
"https://w3id.org/security/v1".parse().unwrap()
|
||||
}
|
||||
|
||||
/// Generate an enum implementing serde's Serialize and Deserialize with a single variant
|
||||
///
|
||||
/// This is useful for describing constants
|
||||
|
|
Loading…
Reference in a new issue