Enum microkelvin::Link [−][src]
pub enum Link<C, A, S> where
S: Store, {
Memory {
rc: Rc<C>,
annotation: RefCell<Option<A>>,
},
Stored {
stored: Stored<C, S>,
a: A,
},
}
Expand description
The Link struct is an annotated merkle link to a compound type
The link takes care of lazily evaluating the annotation of the inner type, and to load it from memory or backend when needed.
Variants
Memory
A Link to a node in memory
Stored
A Link to a stored node
Implementations
pub fn annotation(&self) -> ARef<'_, A> where
C: Compound<A, S>,
C::Leaf: Archive,
A: Annotation<C::Leaf>,
pub fn annotation(&self) -> ARef<'_, A> where
C: Compound<A, S>,
C::Leaf: Archive,
A: Annotation<C::Leaf>,
Returns a reference to to the annotation stored
Unwraps the underlying value, clones or deserializes it
Returns a reference to the inner node, possibly in its stored form
Trait Implementations
type Archived = ArchivedLink<C, A, S>
type Archived = ArchivedLink<C, A, S>
The archived representation of this type. Read more
impl<C, A, S, S2> Deserialize<Link<C, A, S>, S2> for ArchivedLink<C, A, S> where
S: Store,
S2: Store,
for<'a> &'a mut S2: Borrow<S>,
A: Clone,
impl<C, A, S, S2> Deserialize<Link<C, A, S>, S2> for ArchivedLink<C, A, S> where
S: Store,
S2: Store,
for<'a> &'a mut S2: Borrow<S>,
A: Clone,
Auto Trait Implementations
impl<C, A, S> !RefUnwindSafe for Link<C, A, S>
impl<C, A, S> Unpin for Link<C, A, S> where
A: Unpin,
C: Unpin,
S: Unpin,
<S as Store>::Identifier: Unpin,
impl<C, A, S> UnwindSafe for Link<C, A, S> where
A: UnwindSafe,
C: UnwindSafe + RefUnwindSafe,
S: UnwindSafe,
<S as Store>::Identifier: UnwindSafe,
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
The archived counterpart of this type. Unlike Archive
, it may be unsized. Read more
type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
pub unsafe fn resolve_metadata(
&self,
usize,
<T as ArchiveUnsized>::MetadataResolver,
*mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
pub unsafe fn resolve_metadata(
&self,
usize,
<T as ArchiveUnsized>::MetadataResolver,
*mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
Creates the archived version of the metadata for this value at the given position and writes it to the given output. Read more
Mutably borrows from an owned value. Read more