#[non_exhaustive]pub struct GraphHop<E> {
pub edge_id: EdgeId,
pub from: NodeId,
pub to: NodeId,
pub edge: E,
pub timestamp: DateTime<Utc>,
}Expand description
One traversal hop produced by GraphMemory::traverse or
GraphMemory::find_path.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.edge_id: EdgeIdEdge that connects the previous node to node.
from: NodeIdSource of the edge (the previously-visited node).
to: NodeIdDestination of the edge — the freshly-reached node.
edge: EEdge payload.
timestamp: DateTime<Utc>Wall-clock timestamp recorded when the edge was inserted. Carried on the hop so callers don’t have to issue a second backend lookup just to access temporal data.
Implementations§
Source§impl<E> GraphHop<E>
impl<E> GraphHop<E>
Sourcepub const fn new(
edge_id: EdgeId,
from: NodeId,
to: NodeId,
edge: E,
timestamp: DateTime<Utc>,
) -> Self
pub const fn new( edge_id: EdgeId, from: NodeId, to: NodeId, edge: E, timestamp: DateTime<Utc>, ) -> Self
Construct a hop from the five fields every backend supplies.
Backends use this constructor (rather than struct-literal
syntax) so the #[non_exhaustive] evolvability guarantee
holds across the workspace boundary.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for GraphHop<E>where
E: Freeze,
impl<E> RefUnwindSafe for GraphHop<E>where
E: RefUnwindSafe,
impl<E> Send for GraphHop<E>where
E: Send,
impl<E> Sync for GraphHop<E>where
E: Sync,
impl<E> Unpin for GraphHop<E>where
E: Unpin,
impl<E> UnsafeUnpin for GraphHop<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for GraphHop<E>where
E: 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