pub struct Observation {
pub id: ObservationId,
pub kind: ObservationKind,
pub raw_payload_ref: ContentHash,
pub capture_context: CaptureContext,
pub provider: ProviderIdentity,
pub captured_at: Timestamp,
}Expand description
Raw provider output - the evidence ledger.
Observations are immutable records of what a provider returned. They do NOT become facts directly - they must go through the proposal/promotion pipeline.
§Example
use converge_core::types::{
Observation, ObservationKind, ObservationId, ContentHash,
CaptureContext, ProviderIdentity,
};
let obs = Observation::from_api_response(
ObservationId::new("obs-001"),
ContentHash::zero(),
ProviderIdentity::new("openai", "v1"),
CaptureContext::default(),
);
assert_eq!(obs.kind, ObservationKind::ApiResponse);Fields§
§id: ObservationIdUnique identifier for this observation
kind: ObservationKindWhat kind of source this came from
raw_payload_ref: ContentHashHash/pointer to the raw payload (content-addressed)
capture_context: CaptureContextHow the observation was captured
provider: ProviderIdentityWho provided this observation
captured_at: TimestampWhen this was captured
Implementations§
Source§impl Observation
impl Observation
Sourcepub fn from_api_response(
id: ObservationId,
raw_payload_ref: ContentHash,
provider: ProviderIdentity,
capture_context: CaptureContext,
) -> Observation
pub fn from_api_response( id: ObservationId, raw_payload_ref: ContentHash, provider: ProviderIdentity, capture_context: CaptureContext, ) -> Observation
Create an observation from an API response.
Sourcepub fn from_user_input(
id: ObservationId,
raw_payload_ref: ContentHash,
capture_context: CaptureContext,
) -> Observation
pub fn from_user_input( id: ObservationId, raw_payload_ref: ContentHash, capture_context: CaptureContext, ) -> Observation
Create an observation from user input.
Sourcepub fn from_system_event(
id: ObservationId,
raw_payload_ref: ContentHash,
capture_context: CaptureContext,
) -> Observation
pub fn from_system_event( id: ObservationId, raw_payload_ref: ContentHash, capture_context: CaptureContext, ) -> Observation
Create an observation from a system event.
Sourcepub fn from_external_feed(
id: ObservationId,
raw_payload_ref: ContentHash,
provider: ProviderIdentity,
capture_context: CaptureContext,
) -> Observation
pub fn from_external_feed( id: ObservationId, raw_payload_ref: ContentHash, provider: ProviderIdentity, capture_context: CaptureContext, ) -> Observation
Create an observation from an external feed.
Sourcepub fn new(
id: ObservationId,
kind: ObservationKind,
raw_payload_ref: ContentHash,
provider: ProviderIdentity,
capture_context: CaptureContext,
captured_at: Timestamp,
) -> Observation
pub fn new( id: ObservationId, kind: ObservationKind, raw_payload_ref: ContentHash, provider: ProviderIdentity, capture_context: CaptureContext, captured_at: Timestamp, ) -> Observation
Create a generic observation with explicit kind.
Trait Implementations§
Source§impl Clone for Observation
impl Clone for Observation
Source§fn clone(&self) -> Observation
fn clone(&self) -> Observation
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 Observation
impl Debug for Observation
Source§impl<'de> Deserialize<'de> for Observation
impl<'de> Deserialize<'de> for Observation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Observation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Observation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Observation
impl Serialize for Observation
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 Observation
impl RefUnwindSafe for Observation
impl Send for Observation
impl Sync for Observation
impl Unpin for Observation
impl UnsafeUnpin for Observation
impl UnwindSafe for Observation
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