pub struct Fact {
pub id: String,
pub content: String,
/* private fields */
}Expand description
A validated, authoritative assertion in the context.
Facts are append-only. Once added to the context, they are never mutated or removed (within a convergence run). History is preserved.
Fields§
§id: StringUnique identifier within the context key namespace.
content: StringThe fact’s content as a string. Interpretation is key-dependent.
Implementations§
Source§impl Fact
impl Fact
Sourcepub fn key(&self) -> ContextKey
pub fn key(&self) -> ContextKey
Returns the context key this fact belongs to.
Sourcepub fn promotion_record(&self) -> &FactPromotionRecord
pub fn promotion_record(&self) -> &FactPromotionRecord
Returns the immutable promotion record for this fact.
Sourcepub fn created_at(&self) -> &str
pub fn created_at(&self) -> &str
Returns the fact creation timestamp.
Sourcepub fn is_replay_eligible(&self) -> bool
pub fn is_replay_eligible(&self) -> bool
Returns whether the fact is replay-eligible.
Trait Implementations§
Source§impl Serialize for Fact
impl Serialize for Fact
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,
Serialize this value into the given Serde serializer. Read more
impl Eq for Fact
impl StructuralPartialEq for Fact
Auto Trait Implementations§
impl Freeze for Fact
impl RefUnwindSafe for Fact
impl Send for Fact
impl Sync for Fact
impl Unpin for Fact
impl UnsafeUnpin for Fact
impl UnwindSafe for Fact
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.