Skip to main content

NodeStore

Struct NodeStore 

Source
pub struct NodeStore<T> { /* private fields */ }

Implementations§

Source§

impl<T> NodeStore<T>

Source

pub fn new() -> Self

Source

pub fn ref_count(&self) -> usize

Source

pub fn count_type(&self, node_type: NodeType) -> usize

Source

pub fn contains_type(&self, node_type: NodeType) -> bool

Source

pub fn add(&self, values: Vec<T>)
where T: Into<NodeValue<T>> + Clone,

Source

pub fn insert<K>(&self, node_type: NodeType, values: Vec<K>)
where K: Into<NodeValue<T>>,

Source

pub fn map<F, K>(&self, mapper: F) -> Option<K>
where F: Fn(Vec<&NodeValue<T>>) -> K,

Source

pub fn map_by_type<F, K>(&self, node_type: NodeType, mapper: F) -> Option<K>
where F: Fn(&[NodeValue<T>]) -> K,

Trait Implementations§

Source§

impl<T> Clone for NodeStore<T>

Source§

fn clone(&self) -> Self

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<T: Debug> Debug for NodeStore<T>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T: Default> Default for NodeStore<T>

Source§

fn default() -> NodeStore<T>

Returns the “default value” for a type. Read more
Source§

impl<T: Default + Clone> Factory<(usize, NodeType), Option<GraphNode<T>>> for NodeStore<T>

Source§

fn new_instance( &self, (index, node_type): (usize, NodeType), ) -> Option<GraphNode<T>>

Source§

impl<T, F> Factory<(usize, NodeType, F), Option<GraphNode<T>>> for NodeStore<T>
where T: Default + Clone, F: Fn(Arity) -> bool,

Source§

fn new_instance( &self, (index, node_type, filter): (usize, NodeType, F), ) -> Option<GraphNode<T>>

Source§

impl<T, F> Factory<F, Option<TreeNode<T>>> for NodeStore<T>
where T: Default + Clone, F: Fn(Arity) -> bool,

Source§

fn new_instance(&self, input: F) -> Option<TreeNode<T>>

Source§

impl<T: Clone + Default> Factory<NodeType, Option<TreeNode<T>>> for NodeStore<T>

Source§

fn new_instance(&self, input: NodeType) -> Option<TreeNode<T>>

Source§

impl<T> Factory<NodeType, T> for NodeStore<T>
where T: Factory<(), T> + Default,

Source§

fn new_instance(&self, input: NodeType) -> T

Source§

impl<T: Clone> From<&NodeStore<T>> for NodeStore<T>

Source§

fn from(store: &NodeStore<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<HashMap<NodeType, Vec<T>>> for NodeStore<T>
where T: Into<NodeValue<T>>,

Source§

fn from(values: HashMap<NodeType, Vec<T>>) -> Self

Converts to this type from the input type.
Source§

impl<T: Clone> From<Op<T>> for NodeStore<Op<T>>

Source§

fn from(value: Op<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Vec<(NodeType, Vec<T>)>> for NodeStore<T>
where T: Into<NodeValue<T>> + Clone,

Source§

fn from(values: Vec<(NodeType, Vec<T>)>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Vec<T>> for NodeStore<T>
where T: Into<NodeValue<T>> + Clone,

Source§

fn from(values: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: PartialEq> PartialEq for NodeStore<T>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<T> Freeze for NodeStore<T>

§

impl<T> RefUnwindSafe for NodeStore<T>

§

impl<T> Send for NodeStore<T>
where T: Send + Sync,

§

impl<T> Sync for NodeStore<T>
where T: Send + Sync,

§

impl<T> Unpin for NodeStore<T>

§

impl<T> UnsafeUnpin for NodeStore<T>

§

impl<T> UnwindSafe for NodeStore<T>

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, 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> 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.