#[non_exhaustive]pub struct Provenance {
pub origin: Origin,
pub principal: Option<String>,
pub reference: Option<String>,
pub item_url: Option<String>,
pub received_at: i64,
pub received_by: String,
pub digest: String,
}Expand description
Where a brief came from, recorded by AI6 where the brief entered.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.origin: OriginWhat kind of entry point accepted the brief.
principal: Option<String>Who asked, as AI6 authenticated it: the person’s ID, the Source provider, the
Sleeper’s name, the proposing Agent. None for a registry drop.
reference: Option<String>What identifies the request at its principal: the Source item, the Sleeper definition’s fingerprint, the proposing Run.
item_url: Option<String>The Source item’s link, when it has one.
received_at: i64When the brief was accepted, as Unix seconds.
received_by: StringThe Station, or universal-exports for the gateway, that accepted it.
digest: Stringsha256:HEX of the whole brief record as stored (record_digest): any change to
it after it was accepted, its Operation, assignment, data or text, drops the
provenance.
Implementations§
Source§impl Provenance
impl Provenance
Sourcepub fn new(
origin: Origin,
brief: &Brief,
received_by: impl Into<String>,
received_at: i64,
) -> Self
pub fn new( origin: Origin, brief: &Brief, received_by: impl Into<String>, received_at: i64, ) -> Self
Provenance for brief accepted from origin by received_by at received_at
(Unix seconds). The digest is the brief’s record_digest; the Registry takes it
again from the record it stores.
Sourcepub fn with_principal(self, principal: impl Into<String>) -> Self
pub fn with_principal(self, principal: impl Into<String>) -> Self
Records who asked.
Sourcepub fn with_reference(self, reference: impl Into<String>) -> Self
pub fn with_reference(self, reference: impl Into<String>) -> Self
Records what identifies the request at its principal.
Sourcepub fn with_item_url(self, url: Option<String>) -> Self
pub fn with_item_url(self, url: Option<String>) -> Self
Records the Source item’s link.
Sourcepub fn registry_drop(brief: &Brief, station: impl Into<String>, at: i64) -> Self
pub fn registry_drop(brief: &Brief, station: impl Into<String>, at: i64) -> Self
The provenance a Station gives a brief the Registry holds none for.
Sourcepub fn matches(&self, brief: &Brief) -> bool
pub fn matches(&self, brief: &Brief) -> bool
Whether this provenance was recorded for brief as it is now: its record still
hashes to Provenance::digest.
Trait Implementations§
Source§impl Clone for Provenance
impl Clone for Provenance
Source§impl Debug for Provenance
impl Debug for Provenance
Source§impl<'de> Deserialize<'de> for Provenance
impl<'de> Deserialize<'de> for Provenance
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 Provenance
Source§impl FromValue for Provenance
impl FromValue for Provenance
Source§const KINDS: Kinds = ::guatiao::Kinds::MAP
const KINDS: Kinds = ::guatiao::Kinds::MAP
from_value may accept; any
other is refused. Every impl in this crate and every derived one
says; the default, [Kinds::ANY], claims every kind, which keeps
a type that does not say out of an enum told apart by kind.Source§fn from_value(__value: &Value) -> Result<Self, MapError>
fn from_value(__value: &Value) -> Result<Self, MapError>
Source§impl FromWalk for Provenance
impl FromWalk for Provenance
Source§impl MapRead for Provenance
impl MapRead for Provenance
Source§impl PartialEq for Provenance
impl PartialEq for Provenance
Source§impl Schema for Provenance
impl Schema for Provenance
Source§impl Serialize for Provenance
impl Serialize for Provenance
impl StructuralPartialEq for Provenance
Source§impl ToValue for Provenance
impl ToValue for Provenance
Auto Trait Implementations§
impl Freeze for Provenance
impl RefUnwindSafe for Provenance
impl Send for Provenance
impl Sync for Provenance
impl Unpin for Provenance
impl UnsafeUnpin for Provenance
impl UnwindSafe for Provenance
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.