pub struct EdgeBase<N = Uuid> {
pub source: N,
pub target: N,
pub created_at: DateTime<Utc>,
pub archived_at: Option<DateTime<Utc>>,
}Expand description
Common edge data: endpoints plus creation / archival timestamps,
generic over the node identity type N.
Per-kind edge structs embed this and add their own kind-specific
fields. Concrete kinds live in domain crates (kanban-domain holds
SpawnsEdge / BlocksEdge / RelatesEdge, all keyed on Uuid);
external crates can define their own structs the same way and
pick any node identity that satisfies the Edge::NodeId bounds.
Directionality is not on EdgeBase: it’s encoded by the
sub-graph type the edge lives in. DagGraph carries directed
edges, UndirectedGraph carries undirected edges.
Fields§
§source: N§target: N§created_at: DateTime<Utc>§archived_at: Option<DateTime<Utc>>Implementations§
Trait Implementations§
Source§impl<'de, N> Deserialize<'de> for EdgeBase<N>where
N: Deserialize<'de>,
impl<'de, N> Deserialize<'de> for EdgeBase<N>where
N: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<N> Edge for EdgeBase<N>
impl<N> Edge for EdgeBase<N>
Source§type NodeId = N
type NodeId = N
Node identity type for both endpoints.
Copy + Eq + Hash is
what the algorithms need (cycle / reachability work over
HashMap<NodeId, Vec<NodeId>>).fn source(&self) -> N
fn target(&self) -> N
fn created_at(&self) -> DateTime<Utc>
fn archived_at(&self) -> Option<DateTime<Utc>>
fn archive(&mut self)
fn unarchive(&mut self)
Source§fn from_endpoints(source: N, target: N) -> Self
fn from_endpoints(source: N, target: N) -> Self
Construct an edge from just its endpoints, filling per-kind
metadata with defaults. Lets the generic
Graph::add_edge /
UndirectedGraph::add_edge trait methods work uniformly
across edge kinds without taking kind-specific parameters.
Kind-specific code that wants to set metadata explicitly
constructs the concrete struct directly (e.g.
BlocksEdge::new(blocker, blocked, Severity::High)) and
pushes it via add_edge_with_metadata. Read morefn is_active(&self) -> bool
fn is_archived(&self) -> bool
fn involves(&self, node: Self::NodeId) -> bool
Source§impl<N: PartialEq> PartialEq for EdgeBase<N>
impl<N: PartialEq> PartialEq for EdgeBase<N>
impl<N> StructuralPartialEq for EdgeBase<N>
Auto Trait Implementations§
impl<N> Freeze for EdgeBase<N>where
N: Freeze,
impl<N> RefUnwindSafe for EdgeBase<N>where
N: RefUnwindSafe,
impl<N> Send for EdgeBase<N>where
N: Send,
impl<N> Sync for EdgeBase<N>where
N: Sync,
impl<N> Unpin for EdgeBase<N>where
N: Unpin,
impl<N> UnsafeUnpin for EdgeBase<N>where
N: UnsafeUnpin,
impl<N> UnwindSafe for EdgeBase<N>where
N: UnwindSafe,
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