Edge

Struct Edge 

Source
pub struct Edge<'id, N, ET>(/* private fields */);
Expand description

Edge type, see oxidd_core::Edge

Internally, this is represented as a u32 index.

Implementations§

Source§

impl<N: NodeBase, ET: Tag> Edge<'_, N, ET>

Source

pub fn raw(&self) -> u32

Get the raw representation of the edge (also called “edge value”)

Source

pub unsafe fn from_terminal_id(id: u32) -> Self

Get an edge from a terminal ID

§Safety

id must be a terminal ID, i.e., id < TERMINALS, and the caller must update the reference count for the terminal accordingly.

Trait Implementations§

Source§

impl<N, ET> Drop for Edge<'_, N, ET>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'id, ET: Tag, const ARITY: usize> DropWith<Edge<'id, NodeWithLevel<'id, ET, ARITY>, ET>> for NodeWithLevel<'id, ET, ARITY>

Source§

fn drop_with(self, drop_edge: impl Fn(Edge<'id, Self, ET>))

Drop self Read more
Source§

fn drop_with_manager<M>(self, manager: &M)
where M: Manager<Edge = E>,

Drop self Read more
Source§

impl<N: NodeBase, ET: Tag> Edge for Edge<'_, N, ET>

Source§

type Tag = ET

Edge tag Read more
Source§

fn borrowed(&self) -> Borrowed<'_, Self>

Turn a reference into a borrowed handle
Source§

fn with_tag(&self, tag: Self::Tag) -> Borrowed<'_, Self>

Get a version of this Edge with the given tag Read more
Source§

fn with_tag_owned(self, tag: Self::Tag) -> Self

Get a version of this Edge with the given tag
Source§

fn tag(&self) -> Self::Tag

Get the Tag of this Edge
Source§

fn node_id(&self) -> NodeID

Returns some unique identifier for the node, e.g. for I/O purposes
Source§

impl<'id, N, ET> Hash for Edge<'id, N, ET>

Source§

fn hash<__H: Hasher>(&self, __state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'id, ET: Tag, const ARITY: usize> InnerNode<Edge<'id, NodeWithLevel<'id, ET, ARITY>, ET>> for NodeWithLevel<'id, ET, ARITY>

Source§

const ARITY: usize = ARITY

The node’s arity (upper bound)
Source§

type ChildrenIter<'a> = BorrowedEdgeIter<'a, Edge<'id, NodeWithLevel<'id, ET, ARITY>, ET>, Iter<'a, Edge<'id, NodeWithLevel<'id, ET, ARITY>, ET>>> where Self: 'a

Iterator over children of an inner node
Source§

fn new( level: LevelNo, children: impl IntoIterator<Item = Edge<'id, Self, ET>>, ) -> Self

Create a new node Read more
Source§

fn check_level(&self, check: impl FnOnce(LevelNo) -> bool) -> bool

Returns the result of check applied to the node’s level in case this node type stores levels, otherwise returns true. Read more
Source§

fn assert_level_matches(&self, level: LevelNo)

Panics if the node types stores a level and the node’s level is not level
Source§

fn children(&self) -> Self::ChildrenIter<'_>

Get the children of this node as an iterator
Source§

fn child(&self, n: usize) -> Borrowed<'_, Edge<'id, Self, ET>>

Get the n-th child of this node
Source§

unsafe fn set_child( &self, n: usize, child: Edge<'id, Self, ET>, ) -> Edge<'id, Self, ET>

Set the n-th child of this node Read more
Source§

fn ref_count(&self) -> usize

Get the node’s reference count Read more
Source§

impl<'a, 'id, N, ET, TM, R, MD, const TERMINALS: usize> LevelView<Edge<'id, N, ET>, N> for LevelView<'a, 'id, N, ET, TM, R, MD, TERMINALS>
where N: NodeBase + InnerNode<Edge<'id, N, ET>>, ET: Tag, TM: TerminalManager<'id, N, ET, TERMINALS>, MD: DropWith<Edge<'id, N, ET>>,

Source§

type Iterator<'b> = LevelViewIter<'b, 'id, N, ET> where Self: 'b, Edge<'id, N, ET>: 'b

Iterator over Edges pointing to nodes at this level
Source§

type Taken = TakenLevelView<'a, 'id, N, ET, TM, R, MD, TERMINALS>

Taken level view, see LevelView::take()
Source§

fn len(&self) -> usize

Get the number of nodes on this level
Source§

fn level_no(&self) -> LevelNo

Get the level number of this level
Source§

fn reserve(&mut self, additional: usize)

Reserve space for additional nodes on this level
Source§

fn get(&self, node: &N) -> Option<&Edge<'id, N, ET>>

Get the edge corresponding to the given node (if present)
Source§

fn insert(&mut self, edge: Edge<'id, N, ET>) -> bool

Insert the given edge into the unique table at this level, assuming that the referenced node is already stored in the associated manager. Read more
Source§

fn get_or_insert(&mut self, node: N) -> AllocResult<Edge<'id, N, ET>>

Get the edge corresponding to level and node if present, or insert it. Read more
Source§

fn gc(&mut self)

Perform garbage collection on this level Read more
Source§

fn remove(&mut self, node: &N) -> bool

Remove node from (this level of) the manager Read more
Source§

unsafe fn swap(&mut self, other: &mut Self)

Move all nodes from this level to the other level and vice versa. Read more
Source§

fn iter(&self) -> Self::Iterator<'_>

Iterate over all the edges at this level
Source§

fn take(&mut self) -> Self::Taken

Clear this level, returning a level view containing all the previous edges.
Source§

fn is_empty(&self) -> bool

Returns true iff this level contains nodes
Source§

impl<'id, N, ET, TM, R, MD, const TERMINALS: usize> LevelView<Edge<'id, N, ET>, N> for TakenLevelView<'_, 'id, N, ET, TM, R, MD, TERMINALS>
where N: NodeBase + InnerNode<Edge<'id, N, ET>>, ET: Tag, TM: TerminalManager<'id, N, ET, TERMINALS>, MD: DropWith<Edge<'id, N, ET>>,

Source§

type Iterator<'b> = LevelViewIter<'b, 'id, N, ET> where Self: 'b, Edge<'id, N, ET>: 'b

Iterator over Edges pointing to nodes at this level
Source§

type Taken = TakenLevelView<'_, 'id, N, ET, TM, R, MD, TERMINALS>

Taken level view, see LevelView::take()
Source§

fn len(&self) -> usize

Get the number of nodes on this level
Source§

fn level_no(&self) -> LevelNo

Get the level number of this level
Source§

fn reserve(&mut self, additional: usize)

Reserve space for additional nodes on this level
Source§

fn get(&self, node: &N) -> Option<&Edge<'id, N, ET>>

Get the edge corresponding to the given node (if present)
Source§

fn insert(&mut self, edge: Edge<'id, N, ET>) -> bool

Insert the given edge into the unique table at this level, assuming that the referenced node is already stored in the associated manager. Read more
Source§

fn get_or_insert(&mut self, node: N) -> AllocResult<Edge<'id, N, ET>>

Get the edge corresponding to level and node if present, or insert it. Read more
Source§

fn gc(&mut self)

Perform garbage collection on this level Read more
Source§

fn remove(&mut self, node: &N) -> bool

Remove node from (this level of) the manager Read more
Source§

unsafe fn swap(&mut self, other: &mut Self)

Move all nodes from this level to the other level and vice versa. Read more
Source§

fn iter(&self) -> Self::Iterator<'_>

Iterate over all the edges at this level
Source§

fn take(&mut self) -> Self::Taken

Clear this level, returning a level view containing all the previous edges.
Source§

fn is_empty(&self) -> bool

Returns true iff this level contains nodes
Source§

impl<'id, N: NodeBase, ET: Tag> NodeSet<Edge<'id, N, ET>> for NodeSet

Source§

fn len(&self) -> usize

Get the number of nodes in the set
Source§

fn insert(&mut self, edge: &Edge<'id, N, ET>) -> bool

Add a node (the node to which edge points) to the set Read more
Source§

fn contains(&self, edge: &Edge<'id, N, ET>) -> bool

Return true if the set contains the given node
Source§

fn remove(&mut self, edge: &Edge<'id, N, ET>) -> bool

Remove a node from the set Read more
Source§

fn is_empty(&self) -> bool

Returns true iff there are no nodes in the set
Source§

impl<'id, N, ET> Ord for Edge<'id, N, ET>

Source§

fn cmp(&self, __other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'id, N, ET> PartialEq for Edge<'id, N, ET>

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

impl<'id, N, ET> PartialOrd for Edge<'id, N, ET>

Source§

fn partial_cmp(&self, __other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'id, N, ET> Eq for Edge<'id, N, ET>

Auto Trait Implementations§

§

impl<'id, N, ET> Freeze for Edge<'id, N, ET>

§

impl<'id, N, ET> RefUnwindSafe for Edge<'id, N, ET>

§

impl<'id, N, ET> Send for Edge<'id, N, ET>
where N: Send, ET: Send,

§

impl<'id, N, ET> Sync for Edge<'id, N, ET>
where N: Sync, ET: Sync,

§

impl<'id, N, ET> Unpin for Edge<'id, N, ET>
where N: Unpin, ET: Unpin,

§

impl<'id, N, ET> UnwindSafe for Edge<'id, N, ET>
where N: UnwindSafe, ET: UnwindSafe,

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