pub struct TypesFact { /* private fields */ }Expand description
A promoted, governed truth. Immutable after creation.
Facts can only be created via PromotionGate::promote(). Direct construction
is impossible outside converge-core.
§Invariants
- Non-optional PromotionRecord: Every Fact has a complete promotion record
- Immutable: No mutation methods - corrections are new Facts
- Private fields: All access via getters
§Example
// Facts cannot be created directly from external code:
//
// let fact = Fact::new(...); // ERROR: `new` is private
//
// Instead, Facts are created by the PromotionGate:
//
// let fact = promotion_gate.promote(validated_proposal)?;Implementations§
Source§impl Fact
impl Fact
Sourcepub fn content(&self) -> &FactContent
pub fn content(&self) -> &FactContent
Get the fact content.
Sourcepub fn promotion_record(&self) -> &PromotionRecord
pub fn promotion_record(&self) -> &PromotionRecord
Get the promotion record.
This is ALWAYS present (non-optional) per CONTEXT.md requirements.
Sourcepub fn created_at(&self) -> &Timestamp
pub fn created_at(&self) -> &Timestamp
Get the creation timestamp.
Sourcepub fn is_replay_eligible(&self) -> bool
pub fn is_replay_eligible(&self) -> bool
Check if this fact’s promotion is replay-eligible.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Fact
impl<'de> Deserialize<'de> for Fact
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Fact, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Fact, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
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