Trait pargraph::ReadonlyOperator
source · pub trait ReadonlyOperator<G>where
G: GraphBase,{
type WorkItem: Borrow<G::NodeId>;
// Required method
fn op(
&self,
work_item: Self::WorkItem,
local_view: LocalGraphView<&G>,
worklist: impl WorklistPush<Self::WorkItem>
);
}Expand description
Operator which only gets read access to the graph.
The implementation can still write to graph/edge weights
but needs to care about synchronization itself by using apropriate
schemes (for example RwLock and atomics).
Required Associated Types§
sourcetype WorkItem: Borrow<G::NodeId>
type WorkItem: Borrow<G::NodeId>
Type used for representing a graph node.
In order to allow including associated data, the work item can be any type which
allows to borrow a reference to the graph node ID.
Because Borrow<T> is by default also implemented for T, this allows to use graph node IDs
directly as a WorkItem.
Required Methods§
sourcefn op(
&self,
work_item: Self::WorkItem,
local_view: LocalGraphView<&G>,
worklist: impl WorklistPush<Self::WorkItem>
)
fn op( &self, work_item: Self::WorkItem, local_view: LocalGraphView<&G>, worklist: impl WorklistPush<Self::WorkItem> )
Do the graph operation on the given active node.
Object Safety§
This trait is not object safe.