pub struct Edge {Show 13 fields
pub id: EdgeId,
pub src: VertexId,
pub src_type: TypeName,
pub dst: VertexId,
pub dst_type: TypeName,
pub label: String,
pub properties: BTreeMap<String, PropertyValue>,
pub valid_from: Option<DateTime<Utc>>,
pub valid_to: Option<DateTime<Utc>>,
pub observed_at: Option<DateTime<Utc>>,
pub extracted_at: Option<DateTime<Utc>>,
pub confidence: Option<f32>,
pub evidenced_by: Vec<EvidenceId>,
}Expand description
Edge payload: ant_types::Edge is graph-plane; serialize as-is.
Fields§
§id: EdgeId§src: VertexId§src_type: TypeName§dst: VertexId§dst_type: TypeName§label: StringRelation name (e.g. “hasStakeholder”), NOT namespace-qualified.
properties: BTreeMap<String, PropertyValue>§valid_from: Option<DateTime<Utc>>§valid_to: Option<DateTime<Utc>>§observed_at: Option<DateTime<Utc>>§extracted_at: Option<DateTime<Utc>>§confidence: Option<f32>Confidence in [0,1] for the fact. None is treated as 1.0 for
matching purposes.
evidenced_by: Vec<EvidenceId>First-class evidence references. Empty by default (backwards-compatible with older payloads).
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn valid_at(&self, t: DateTime<Utc>) -> bool
pub fn valid_at(&self, t: DateTime<Utc>) -> bool
Returns true iff this edge is valid at the given instant.
Edges with no valid_from are treated as valid from -infinity.
Edges with no valid_to are treated as still-holding.
Sourcepub fn valid_between(&self, t1: DateTime<Utc>, t2: DateTime<Utc>) -> bool
pub fn valid_between(&self, t1: DateTime<Utc>, t2: DateTime<Utc>) -> bool
Returns true iff this edge’s validity interval overlaps [t1, t2).
Sourcepub fn still_holds(&self) -> bool
pub fn still_holds(&self) -> bool
True if the edge is currently active (valid_to is None).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Edge
impl<'de> Deserialize<'de> for Edge
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Edge, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Edge, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Edge
impl Serialize for Edge
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 StructuralPartialEq for Edge
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnsafeUnpin for Edge
impl UnwindSafe for Edge
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