Skip to main content

GenericNodeState

Struct GenericNodeState 

Source
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>

Source

pub fn values_ref(&self) -> &RecordBatch

Source

pub fn keys_ref(&self) -> Option<&Index<VID>>

Source§

impl<'graph, G: IntoDynamic> GenericNodeState<'graph, G>

Source§

impl<'graph, G: GraphViewOps<'graph>> GenericNodeState<'graph, G>

Source

pub fn new( base_graph: G, values: RecordBatch, keys: Option<Index<VID>>, node_cols: Option<HashMap<String, (NodeStateOutputType, Option<G>)>>, ) -> Self

Source

pub fn get_nodes( state: &GenericNodeState<'graph, G>, value_map: PropMap, ) -> TransformedPropMap<'graph, G>

Source

pub fn to_output_nodestate(self) -> OutputTypedNodeState<'graph, G>

Source

pub fn into_inner(self) -> (RecordBatch, Option<Index<VID>>)

Source

pub fn values(&self) -> &RecordBatch

Source

pub fn from_parquet<P: AsRef<Path>>( &self, file_path: P, id_column: Option<String>, ) -> Result<GenericNodeState<'graph, G>, GraphError>

Source

pub fn to_parquet<P: AsRef<Path>>( &self, file_path: P, id_column: Option<String>, )

Source

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>

Source

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

Source

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

Source

pub fn new_empty(graph: G) -> Self

create a new empty NodeState

Source

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 view
  • values: the unfiltered values (i.e., values.len() == graph.unfiltered_num_nodes()). This method handles the filtering.
Source

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 view
  • values: the unfiltered values (i.e., values.len() == graph.unfiltered_num_nodes()). This method handles the filtering.
  • map: Closure mapping input to output values
Source

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)

Source

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

Source

pub fn sort_by( &self, sort_params: IndexMap<String, Option<String>>, ) -> Result<GenericNodeState<'graph, G>, GraphError>

Synchronous sort implementation using arrow-row

Source

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<'graph, G: Debug> Debug for GenericNodeState<'graph, G>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more