pub struct NetworkSnapshot { /* private fields */ }Expand description
Immutable versioned view of a links network.
Implementations§
Source§impl NetworkSnapshot
impl NetworkSnapshot
Sourcepub fn new(
version: u64,
network: LinkNetwork,
provenance: impl Into<String>,
) -> Self
pub fn new( version: u64, network: LinkNetwork, provenance: impl Into<String>, ) -> Self
Creates an immutable snapshot from a network value.
Sourcepub const fn parent_version(&self) -> Option<u64>
pub const fn parent_version(&self) -> Option<u64>
Parent version when this snapshot was committed from a mutable snapshot.
Sourcepub fn provenance(&self) -> &str
pub fn provenance(&self) -> &str
Human-readable change provenance for this snapshot.
Sourcepub fn network(&self) -> &LinkNetwork
pub fn network(&self) -> &LinkNetwork
Immutable network data held by this snapshot.
Number of immutable snapshot handles sharing the same network value.
Sourcepub fn from_read_only(
version: u64,
view: &ReadOnlyNetwork,
provenance: impl Into<String>,
) -> Self
pub fn from_read_only( version: u64, view: &ReadOnlyNetwork, provenance: impl Into<String>, ) -> Self
Builds an immutable snapshot from a frozen read-only view.
The read-only view’s Arc<LinkNetwork> is reused directly, so freezing
and snapshot versioning share one network allocation.
Sourcepub fn as_read_only(&self) -> ReadOnlyNetwork
pub fn as_read_only(&self) -> ReadOnlyNetwork
Returns a read-only view sharing this snapshot’s network allocation.
Sourcepub fn structural_diff(&self, other: &Self) -> StructuralDiff
pub fn structural_diff(&self, other: &Self) -> StructuralDiff
Computes changed, added, and removed link ids against another snapshot.
Sourcepub fn to_mutable(
&self,
provenance: impl Into<String>,
) -> MutableNetworkSnapshot
pub fn to_mutable( &self, provenance: impl Into<String>, ) -> MutableNetworkSnapshot
Creates an editable snapshot fork from this immutable snapshot.
Trait Implementations§
Source§impl Clone for NetworkSnapshot
impl Clone for NetworkSnapshot
Source§fn clone(&self) -> NetworkSnapshot
fn clone(&self) -> NetworkSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkSnapshot
impl Debug for NetworkSnapshot
Source§impl PartialEq for NetworkSnapshot
impl PartialEq for NetworkSnapshot
impl Eq for NetworkSnapshot
impl StructuralPartialEq for NetworkSnapshot
Auto Trait Implementations§
impl Freeze for NetworkSnapshot
impl RefUnwindSafe for NetworkSnapshot
impl Send for NetworkSnapshot
impl Sync for NetworkSnapshot
impl Unpin for NetworkSnapshot
impl UnsafeUnpin for NetworkSnapshot
impl UnwindSafe for NetworkSnapshot
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.