pub struct Context(pub OneOrMany<ContextEntry>);Expand description
The value of a JSON-LD @context property.
May be a single entry (emitted as a bare value) or multiple entries
(emitted as an array). The wire format is driven by OneOrMany.
Tuple Fields§
§0: OneOrMany<ContextEntry>Implementations§
Source§impl Context
impl Context
Sourcepub const AS2: &'static str = "https://www.w3.org/ns/activitystreams"
pub const AS2: &'static str = "https://www.w3.org/ns/activitystreams"
The canonical Activity Streams 2.0 context URI.
Sourcepub const CID_V1: &'static str = "https://www.w3.org/ns/cid/v1"
pub const CID_V1: &'static str = "https://www.w3.org/ns/cid/v1"
The Controlled Identifiers v1 context, required by FEP-521a.
Sourcepub const DATA_INTEGRITY_V2: &'static str = "https://w3id.org/security/data-integrity/v2"
pub const DATA_INTEGRITY_V2: &'static str = "https://w3id.org/security/data-integrity/v2"
The Data Integrity v2 context, required by FEP-8b32 proofs.
Sourcepub const SECURITY_V1: &'static str = "https://w3id.org/security/v1"
pub const SECURITY_V1: &'static str = "https://w3id.org/security/v1"
The legacy Security v1 context used by older Mastodon actors.
Sourcepub fn activitystreams() -> Self
pub fn activitystreams() -> Self
Creates a Context containing only the canonical AS 2.0 URI.
Sourcepub fn activitystreams_security() -> Self
pub fn activitystreams_security() -> Self
Creates a Context containing the AS 2.0 URI plus the Security v1
URI — the combination emitted by most current Fediverse actors.
Sourcepub fn activitystreams_integrity() -> Self
pub fn activitystreams_integrity() -> Self
Creates a Context containing AS 2.0 plus the Data Integrity
context — the combination required when emitting FEP-8b32 proofs.
Sourcepub fn entries(&self) -> &[ContextEntry]
pub fn entries(&self) -> &[ContextEntry]
Returns the entries of this context.
Sourcepub fn push(&mut self, entry: ContextEntry)
pub fn push(&mut self, entry: ContextEntry)
Appends an entry to this context.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.