Enum ReducedOrNew

Source
pub enum ReducedOrNew<E: Edge, N: InnerNode<E>> {
    Reduced(E),
    New(N, E::Tag),
}
Expand description

Result of the attempt to create a new node

Before actually creating a new node, reduction rules should be applied (see DiagramRules::reduce()). If a reduction was applied, then DiagramRules::reduce() returns the Reduced variant, otherwise the New variant.

Variants§

§

Reduced(E)

A reduction rule was applied

§

New(N, E::Tag)

The node is new. After inserting it into the manager, the edge should be tagged with the given tag.

Implementations§

Source§

impl<E: Edge, N: InnerNode<E>> ReducedOrNew<E, N>

Source

pub fn then_insert<M>(self, manager: &M, level: LevelNo) -> AllocResult<E>
where M: Manager<InnerNode = N, Edge = E>,

Insert self into manager and unique_table at the given level if it is New, otherwise return the Reduced edge.

level must agree with the level used for creating the node, and must be strictly above (i.e. less than) the children’s levels.

Auto Trait Implementations§

§

impl<E, N> Freeze for ReducedOrNew<E, N>
where E: Freeze, N: Freeze, <E as Edge>::Tag: Freeze,

§

impl<E, N> RefUnwindSafe for ReducedOrNew<E, N>

§

impl<E, N> Send for ReducedOrNew<E, N>
where E: Send, N: Send, <E as Edge>::Tag: Send,

§

impl<E, N> Sync for ReducedOrNew<E, N>
where E: Sync, N: Sync, <E as Edge>::Tag: Sync,

§

impl<E, N> Unpin for ReducedOrNew<E, N>
where E: Unpin, N: Unpin, <E as Edge>::Tag: Unpin,

§

impl<E, N> UnwindSafe for ReducedOrNew<E, N>
where E: UnwindSafe, N: UnwindSafe, <E as Edge>::Tag: 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, 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.