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>
impl<E: Edge, N: InnerNode<E>> ReducedOrNew<E, N>
Sourcepub fn then_insert<M>(self, manager: &M, level: LevelNo) -> AllocResult<E>where
M: Manager<InnerNode = N, Edge = E>,
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>
impl<E, N> RefUnwindSafe for ReducedOrNew<E, N>
impl<E, N> Send for ReducedOrNew<E, N>
impl<E, N> Sync for ReducedOrNew<E, N>
impl<E, N> Unpin for ReducedOrNew<E, N>
impl<E, N> UnwindSafe for ReducedOrNew<E, N>
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