pub struct NodeLayer { /* private fields */ }Expand description
Changes to node identity laid over a fold’s IdMap, labels and
interner: the nodes inserted since (dense ids from id_floor up, exactly
as the writer allocated or will allocate them), the nodes deleted,
relabelled or renamed, and the symbols interned (from sym_floor up).
It is a layer, not a copy: it holds only what changed, and a GraphView
reads it before the state below. Building one and reading through it cost
nothing proportional to the store.
Implementations§
Source§impl NodeLayer
impl NodeLayer
Sourcepub fn new(ids: &IdMap, syms: &Interner) -> Self
pub fn new(ids: &IdMap, syms: &Interner) -> Self
An empty layer over the state whose ids and symbols are ids and
syms.
Sourcepub fn intern(&mut self, below: &Interner, name: &str) -> u32
pub fn intern(&mut self, below: &Interner, name: &str) -> u32
The symbol for name: the one below if it exists there, else this
layer’s, allocated on first use — the id Interner::intern would give.
Sourcepub fn insert(&mut self, key: &str, label_sym: u32) -> u32
pub fn insert(&mut self, key: &str, label_sym: u32) -> u32
Allocate the next dense id for a node key with label label_sym —
the id IdMap::try_insert would give. The caller has checked that
key is not live.
Trait Implementations§
Auto Trait Implementations§
impl Forget for NodeLayer
impl Freeze for NodeLayer
impl RefUnwindSafe for NodeLayer
impl Send for NodeLayer
impl Sync for NodeLayer
impl Unpin for NodeLayer
impl UnsafeUnpin for NodeLayer
impl UnwindSafe for NodeLayer
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.