pub struct FactObservation { /* private fields */ }Expand description
A selected boolean observation and bounded source metadata, never a domain object.
Source and revision labels are application assertions, not verified credentials. An observation inherits the tenant/resource scope of its enclosing decision.
Implementations§
Source§impl FactObservation
impl FactObservation
Sourcepub fn new(
fact: FactId,
value: bool,
metadata: Option<FactResolutionMetadata>,
observed_at: OffsetDateTime,
) -> Result<Self, ObservationError>
pub fn new( fact: FactId, value: bool, metadata: Option<FactResolutionMetadata>, observed_at: OffsetDateTime, ) -> Result<Self, ObservationError>
Records a bounded fact identity, boolean and optional source provenance.
§Errors
Rejects oversized identities and impossible freshness windows.
Sourcepub const fn metadata(&self) -> Option<&FactResolutionMetadata>
pub const fn metadata(&self) -> Option<&FactResolutionMetadata>
Source-provided metadata; absence makes no provenance claim.
Sourcepub const fn observed_at(&self) -> OffsetDateTime
pub const fn observed_at(&self) -> OffsetDateTime
When this check was observed.
Sourcepub fn validate_at(
&self,
now: OffsetDateTime,
) -> Result<(), FactResolutionError>
pub fn validate_at( &self, now: OffsetDateTime, ) -> Result<(), FactResolutionError>
Trait Implementations§
Source§impl Clone for FactObservation
impl Clone for FactObservation
Source§fn clone(&self) -> FactObservation
fn clone(&self) -> FactObservation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FactObservation
impl Debug for FactObservation
Source§impl<'de> Deserialize<'de> for FactObservation
impl<'de> Deserialize<'de> for FactObservation
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FactObservation
Source§impl PartialEq for FactObservation
impl PartialEq for FactObservation
Source§impl Serialize for FactObservation
impl Serialize for FactObservation
impl StructuralPartialEq for FactObservation
Auto Trait Implementations§
impl Freeze for FactObservation
impl RefUnwindSafe for FactObservation
impl Send for FactObservation
impl Sync for FactObservation
impl Unpin for FactObservation
impl UnsafeUnpin for FactObservation
impl UnwindSafe for FactObservation
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