Enum microkelvin::Link
source ·
[−]pub enum Link<C, A, I> {
Memory {
rc: Rc<C>,
annotation: RefCell<Option<A>>,
},
Stored {
stored: Stored<C, I>,
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, I>,
C::Leaf: Archive,
A: Annotation<C::Leaf>,
pub fn annotation(&self) -> ARef<'_, A> where
C: Compound<A, I>,
C::Leaf: Archive,
A: Annotation<C::Leaf>,
Returns a reference to to the annotation stored
pub fn unlink(self) -> C where
C: Compound<A, I> + Clone,
C::Archived: Deserialize<C, StoreRef<I>> + for<'a> CheckBytes<DefaultValidator<'a>>,
pub fn unlink(self) -> C where
C: Compound<A, I> + Clone,
C::Archived: Deserialize<C, StoreRef<I>> + for<'a> CheckBytes<DefaultValidator<'a>>,
Unwraps the underlying value, clones or deserializes it
Returns a reference to the inner node, possibly in its stored form
pub fn inner_mut(&mut self) -> &mut C where
C: Archive + Clone,
C::Archived: Deserialize<C, StoreRef<I>> + for<'a> CheckBytes<DefaultValidator<'a>>,
pub fn inner_mut(&mut self) -> &mut C where
C: Archive + Clone,
C::Archived: Deserialize<C, StoreRef<I>> + for<'a> CheckBytes<DefaultValidator<'a>>,
Returns a Mutable reference to the underlying compound node
Drops cached annotations and ids
Trait Implementations
type Archived = ArchivedLink<C, A, I>
type Archived = ArchivedLink<C, A, I>
The archived representation of this type. Read more
The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type. Read more
impl<C, A, I, D> Deserialize<Link<C, A, I>, D> for ArchivedLink<C, A, I> where
A: Clone,
I: Clone,
D: StoreProvider<I>,
impl<C, A, I, D> Deserialize<Link<C, A, I>, D> for ArchivedLink<C, A, I> where
A: Clone,
I: Clone,
D: StoreProvider<I>,
impl<C, A, I, S> Serialize<S> for Link<C, A, I> where
C: Compound<A, I> + Serialize<S> + Serialize<StoreSerializer<I>>,
A: Clone + Annotation<C::Leaf>,
I: Clone,
S: BorrowMut<StoreSerializer<I>> + Fallible,
impl<C, A, I, S> Serialize<S> for Link<C, A, I> where
C: Compound<A, I> + Serialize<S> + Serialize<StoreSerializer<I>>,
A: Clone + Annotation<C::Leaf>,
I: Clone,
S: BorrowMut<StoreSerializer<I>> + Fallible,
Auto Trait Implementations
impl<C, A, I> !RefUnwindSafe for Link<C, A, I>
impl<C, A, I> !UnwindSafe for Link<C, A, I>
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
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
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
Gets the layout of the type.