pub struct GenericNodeState<'graph, G> {
pub base_graph: G,
pub node_cols: HashMap<String, (NodeStateOutputType, Option<G>)>,
/* private fields */
}Fields§
§base_graph: G§node_cols: HashMap<String, (NodeStateOutputType, Option<G>)>Implementations§
Source§impl<'graph, G> GenericNodeState<'graph, G>
impl<'graph, G> GenericNodeState<'graph, G>
pub fn values_ref(&self) -> &RecordBatch
pub fn keys_ref(&self) -> Option<&Index<VID>>
Source§impl<'graph, G: IntoDynamic> GenericNodeState<'graph, G>
impl<'graph, G: IntoDynamic> GenericNodeState<'graph, G>
pub fn into_dyn(self) -> GenericNodeState<'graph, DynamicGraph>
Source§impl<'graph, G: GraphViewOps<'graph>> GenericNodeState<'graph, G>
impl<'graph, G: GraphViewOps<'graph>> GenericNodeState<'graph, G>
pub fn new( base_graph: G, values: RecordBatch, keys: Option<Index<VID>>, node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>, ) -> Self
pub fn get_nodes( state: &GenericNodeState<'graph, G>, value_map: PropMap, ) -> TransformedPropMap<'graph, G>
pub fn to_output_nodestate(self) -> OutputTypedNodeState<'graph, G>
pub fn into_inner(self) -> (RecordBatch, Option<Index<VID>>)
pub fn values(&self) -> &RecordBatch
pub fn from_parquet<P: AsRef<Path>>( &self, file_path: P, id_column: Option<String>, ) -> Result<GenericNodeState<'graph, G>, GraphError>
pub fn to_parquet<P: AsRef<Path>>( &self, file_path: P, id_column: Option<String>, )
pub fn merge( &self, other: &GenericNodeState<'graph, G>, index_merge_priority: MergePriority, default_column_merge_priority: MergePriority, column_merge_priority_map: Option<HashMap<String, MergePriority>>, ) -> Self
Source§impl<'graph, G: GraphViewOps<'graph>> GenericNodeState<'graph, G>
impl<'graph, G: GraphViewOps<'graph>> GenericNodeState<'graph, G>
pub fn new_from_eval_with_index<V: NodeStateValue>( graph: G, values: Vec<V>, index: Option<Index<VID>>, node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>, ) -> Self
pub fn new_from_eval_with_index_mapped<R: Clone, V: NodeStateValue>( graph: G, values: Vec<R>, index: Option<Index<VID>>, map: impl Fn(R) -> V, node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>, ) -> Self
Sourcepub fn new_from_eval<V: NodeStateValue>(
graph: G,
values: Vec<V>,
node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>,
) -> Self
pub fn new_from_eval<V: NodeStateValue>( graph: G, values: Vec<V>, node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>, ) -> Self
Construct a node state from an eval result
§Arguments
graph: the graph viewvalues: the unfiltered values (i.e.,values.len() == graph.unfiltered_num_nodes()). This method handles the filtering.
Sourcepub fn new_from_eval_mapped<R: Clone, V: NodeStateValue>(
graph: G,
values: Vec<R>,
map: impl Fn(R) -> V,
node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>,
) -> Self
pub fn new_from_eval_mapped<R: Clone, V: NodeStateValue>( graph: G, values: Vec<R>, map: impl Fn(R) -> V, node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>, ) -> Self
Construct a node state from an eval result, mapping values
§Arguments
graph: the graph viewvalues: the unfiltered values (i.e.,values.len() == graph.unfiltered_num_nodes()). This method handles the filtering.map: Closure mapping input to output values
Sourcepub fn new_from_values(
graph: G,
values: impl Into<RecordBatch>,
node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>,
) -> Self
pub fn new_from_values( graph: G, values: impl Into<RecordBatch>, node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>, ) -> Self
create a new NodeState from a list of values for the node (takes care of creating an index for node filtering when needed)
Sourcepub fn new_from_map<R: NodeStateValue, S: BuildHasher, V: NodeStateValue>(
graph: G,
values: HashMap<VID, R, S>,
map: impl Fn(R) -> V,
node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>,
) -> Self
pub fn new_from_map<R: NodeStateValue, S: BuildHasher, V: NodeStateValue>( graph: G, values: HashMap<VID, R, S>, map: impl Fn(R) -> V, node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>, ) -> Self
create a new NodeState from a HashMap of values
Sourcepub fn sort_by(
&self,
sort_params: IndexMap<String, Option<String>>,
) -> Result<GenericNodeState<'graph, G>, GraphError>
pub fn sort_by( &self, sort_params: IndexMap<String, Option<String>>, ) -> Result<GenericNodeState<'graph, G>, GraphError>
Synchronous sort implementation using arrow-row
Sourcepub fn top_k(
&self,
sort_params: IndexMap<String, Option<String>>,
k: usize,
) -> Result<GenericNodeState<'graph, G>, GraphError>
pub fn top_k( &self, sort_params: IndexMap<String, Option<String>>, k: usize, ) -> Result<GenericNodeState<'graph, G>, GraphError>
Given a single RecordBatch, return the top k rows according to sort_exprs.
The returned batch has at most k rows, sorted from lowest to highest
in the order defined by sort_exprs (which may individually be ASC or DESC).
Trait Implementations§
Source§impl<'graph, G: Clone> Clone for GenericNodeState<'graph, G>
impl<'graph, G: Clone> Clone for GenericNodeState<'graph, G>
Source§fn clone(&self) -> GenericNodeState<'graph, G>
fn clone(&self) -> GenericNodeState<'graph, G>
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<'graph, G> Freeze for GenericNodeState<'graph, G>where
G: Freeze,
impl<'graph, G> !RefUnwindSafe for GenericNodeState<'graph, G>
impl<'graph, G> Send for GenericNodeState<'graph, G>where
G: Send,
impl<'graph, G> Sync for GenericNodeState<'graph, G>where
G: Sync,
impl<'graph, G> Unpin for GenericNodeState<'graph, G>where
G: Unpin,
impl<'graph, G> UnsafeUnpin for GenericNodeState<'graph, G>where
G: UnsafeUnpin,
impl<'graph, G> !UnwindSafe for GenericNodeState<'graph, G>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more