Struct holochain::core::workflow::sys_validation_workflow::validation_deps::ValidationDependencies
source · pub struct ValidationDependencies { /* private fields */ }
Expand description
A collection of validation dependencies for the current set of DHT ops requiring validation. This is used as an in-memory cache of dependency info, held across all validation workflow calls, to minimize the amount of network and database calls needed to check if dependencies have been satisfied
Implementations§
source§impl ValidationDependencies
impl ValidationDependencies
pub fn new() -> Self
sourcepub fn has(&mut self, hash: &ActionHash) -> bool
pub fn has(&mut self, hash: &ActionHash) -> bool
Check whether a given dependency is currently held. Note that we may have this dependency as a key but the state won’t contain the dependency because this is how we’re tracking ops we know we need to fetch from the network.
sourcepub fn get(
&mut self,
hash: &ActionHash
) -> Option<&mut ValidationDependencyState>
pub fn get( &mut self, hash: &ActionHash ) -> Option<&mut ValidationDependencyState>
Get the state of a given dependency. This should always return a value because we should know about the depdendency by examining the ops that are being validated. However, the dependency may not be found on the DHT yet.
sourcepub fn get_missing_hashes(&self) -> Vec<ActionHash>
pub fn get_missing_hashes(&self) -> Vec<ActionHash>
Get the hashes of all dependencies that are currently missing from the DHT.
sourcepub fn get_network_fetched_hashes(&self) -> Vec<ActionHash>
pub fn get_network_fetched_hashes(&self) -> Vec<ActionHash>
Get the hashes of all dependencies that have been fetched from the network. We need to let the incoming dht ops workflow know about these so that it can ingest them and get them validated.
sourcepub fn insert(
&mut self,
action: SignedActionHashed,
source: CascadeSource
) -> bool
pub fn insert( &mut self, action: SignedActionHashed, source: CascadeSource ) -> bool
Insert a record which was found after this set of dependencies was created.
sourcepub fn clear_retained_deps(&mut self)
pub fn clear_retained_deps(&mut self)
Forget which dependencies have been accessed since this method was last called.
This is intended to be used with Self::purge_held_deps
to remove any dependencies that are no longer needed.
sourcepub fn purge_held_deps(&mut self)
pub fn purge_held_deps(&mut self)
Remove any dependencies that are no longer needed for validation.
Trait Implementations§
source§impl Default for ValidationDependencies
impl Default for ValidationDependencies
source§impl FromIterator<(HoloHash<Action>, ValidationDependencyState)> for ValidationDependencies
impl FromIterator<(HoloHash<Action>, ValidationDependencyState)> for ValidationDependencies
source§fn from_iter<T: IntoIterator<Item = (ActionHash, ValidationDependencyState)>>(
iter: T
) -> Self
fn from_iter<T: IntoIterator<Item = (ActionHash, ValidationDependencyState)>>( iter: T ) -> Self
Auto Trait Implementations§
impl RefUnwindSafe for ValidationDependencies
impl Send for ValidationDependencies
impl Sync for ValidationDependencies
impl Unpin for ValidationDependencies
impl UnwindSafe for ValidationDependencies
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.