pub struct PregelNode<S: State> {
pub name: String,
pub channels: Vec<String>,
pub triggers: Vec<String>,
pub bound: NodeArc<S>,
pub writers: Vec<ChannelWrite>,
}Expand description
A node in the Pregel execution engine.
PregelNode wraps a user’s node with metadata about which channels it reads from and writes to, and what triggers it.
Fields§
§name: StringThe name of this node
channels: Vec<String>The channels this node reads from
triggers: Vec<String>The channels that trigger this node when written to
bound: NodeArc<S>The actual node computation
writers: Vec<ChannelWrite>The channels this node writes to
Implementations§
Source§impl<S: State> PregelNode<S>
impl<S: State> PregelNode<S>
Sourcepub fn new(
name: impl Into<String>,
channels: Vec<String>,
triggers: Vec<String>,
bound: NodeArc<S>,
writers: Vec<ChannelWrite>,
) -> Self
pub fn new( name: impl Into<String>, channels: Vec<String>, triggers: Vec<String>, bound: NodeArc<S>, writers: Vec<ChannelWrite>, ) -> Self
Create a new PregelNode
Sourcepub fn from_node(
name: impl Into<String>,
channels: Vec<String>,
triggers: Vec<String>,
bound: impl Node<S> + 'static,
writers: Vec<ChannelWrite>,
) -> Self
pub fn from_node( name: impl Into<String>, channels: Vec<String>, triggers: Vec<String>, bound: impl Node<S> + 'static, writers: Vec<ChannelWrite>, ) -> Self
Create a PregelNode from a concrete node implementation
Sourcepub fn is_triggered(&self, written_channels: &[String]) -> bool
pub fn is_triggered(&self, written_channels: &[String]) -> bool
Check if this node is triggered by the given channel writes
Trait Implementations§
Source§impl<S: Clone + State> Clone for PregelNode<S>
impl<S: Clone + State> Clone for PregelNode<S>
Source§fn clone(&self) -> PregelNode<S>
fn clone(&self) -> PregelNode<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<S> Freeze for PregelNode<S>
impl<S> !RefUnwindSafe for PregelNode<S>
impl<S> Send for PregelNode<S>
impl<S> Sync for PregelNode<S>
impl<S> Unpin for PregelNode<S>
impl<S> UnsafeUnpin for PregelNode<S>
impl<S> !UnwindSafe for PregelNode<S>
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