pub enum ContextType {
DataSnapshot,
Analysis,
Prediction,
Alert,
KeyRevocation,
Custom(String),
}Expand description
Registered context types plus open-ended custom namespace.
Wire form is a single string. Standard values (data_snapshot,
analysis, prediction, alert, and — since acdp/0.3.0 —
key-revocation, RFC-ACDP-0014 §4) deserialize to the named variants;
any other value MUST be a namespaced custom type matching
^[a-z][a-z0-9_]*:[a-z][a-z0-9_-]*$ (e.g. finance:portfolio_snapshot)
per acdp-common.schema.json#/$defs/context_type. Inputs that match
neither are rejected at deserialization time so the type cannot encode
schema-invalid context types.
Variants§
DataSnapshot
data_snapshot — point-in-time data.
Analysis
analysis.
Prediction
prediction.
Alert
alert.
KeyRevocation
key-revocation — a producer’s time-scoped declaration that one
of its signing keys is compromised (RFC-ACDP-0014 §4; standard in
acdp/0.3.0). The interim form published on pre-0.3.0 registries
is the namespaced custom type acdp:key-revocation
(ContextType::Custom); use ContextType::is_key_revocation
to recognize both, as 0.3.0 consumers MUST (RFC-ACDP-0014 §10).
Custom(String)
Namespaced custom type, e.g. finance:portfolio_snapshot.
MUST match ^[a-z][a-z0-9_]*:[a-z][a-z0-9_-]*$.
Implementations§
Source§impl ContextType
impl ContextType
Sourcepub const KEY_REVOCATION_INTERIM: &'static str = "acdp:key-revocation"
pub const KEY_REVOCATION_INTERIM: &'static str = "acdp:key-revocation"
The interim namespaced form of key-revocation accepted from
pre-0.3.0 registries (RFC-ACDP-0014 §10).
Sourcepub fn is_key_revocation(&self) -> bool
pub fn is_key_revocation(&self) -> bool
True when this type denotes an RFC-ACDP-0014 key-revocation
context: the standard key-revocation form or the interim
acdp:key-revocation custom form, which 0.3.0 consumers MUST
treat as equivalent when the body satisfies §4–§5
(RFC-ACDP-0014 §10).
Trait Implementations§
Source§impl Clone for ContextType
impl Clone for ContextType
Source§fn clone(&self) -> ContextType
fn clone(&self) -> ContextType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContextType
impl Debug for ContextType
Source§impl<'de> Deserialize<'de> for ContextType
impl<'de> Deserialize<'de> for ContextType
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ContextType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ContextType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for ContextType
Source§impl PartialEq for ContextType
impl PartialEq for ContextType
Source§fn eq(&self, other: &ContextType) -> bool
fn eq(&self, other: &ContextType) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ContextType
impl Serialize for ContextType
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for ContextType
Auto Trait Implementations§
impl Freeze for ContextType
impl RefUnwindSafe for ContextType
impl Send for ContextType
impl Sync for ContextType
impl Unpin for ContextType
impl UnsafeUnpin for ContextType
impl UnwindSafe for ContextType
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.