Struct holochain_integrity_types::chain::ChainFilter
source · pub struct ChainFilter<H: Eq + Ord + Hash = ActionHash> {
pub chain_top: H,
pub filters: ChainFilters<H>,
pub include_cached_entries: bool,
}
Expand description
Filter source chain items.
Starting from some chain position given as an ActionHash
the chain is walked backwards to genesis.
The filter can stop early by specifying the number of
chain items to take and / or an ActionHash
to consume until.
Fields§
§chain_top: H
The starting position of the filter.
filters: ChainFilters<H>
The filters that have been applied.
Defaults to ChainFilters::ToGenesis
.
include_cached_entries: bool
Should the query return any entries that are cached at the agent activity to save network hops.
Implementations§
source§impl<H: Eq + Ord + Hash> ChainFilter<H>
impl<H: Eq + Ord + Hash> ChainFilter<H>
sourcepub fn new(chain_top: H) -> Self
pub fn new(chain_top: H) -> Self
Create a new filter using this ActionHash
as
the starting position and walking the chain
towards the genesis Action
.
sourcepub fn take(self, n: u32) -> Self
pub fn take(self, n: u32) -> Self
Take up to n
actions including the starting position.
This may return less then n
actions.
sourcepub fn include_cached_entries(self) -> Self
pub fn include_cached_entries(self) -> Self
Set this filter to include any cached entries at the agent activity authority.
sourcepub fn until(self, action_hash: H) -> Self
pub fn until(self, action_hash: H) -> Self
Take all actions until this action hash is found.
Note that all actions specified as until
hashes must be
found so this filter can produce deterministic results.
It is invalid to specify an until hash that is on a different
fork then the starting position.
Trait Implementations§
source§impl<H: Clone + Eq + Ord + Hash> Clone for ChainFilter<H>
impl<H: Clone + Eq + Ord + Hash> Clone for ChainFilter<H>
source§fn clone(&self) -> ChainFilter<H>
fn clone(&self) -> ChainFilter<H>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'de, H> Deserialize<'de> for ChainFilter<H>
impl<'de, H> Deserialize<'de> for ChainFilter<H>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<H: PartialEq + Eq + Ord + Hash> PartialEq for ChainFilter<H>
impl<H: PartialEq + Eq + Ord + Hash> PartialEq for ChainFilter<H>
source§fn eq(&self, other: &ChainFilter<H>) -> bool
fn eq(&self, other: &ChainFilter<H>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<H> Serialize for ChainFilter<H>
impl<H> Serialize for ChainFilter<H>
source§impl TryFrom<&ChainFilter> for SerializedBytes
impl TryFrom<&ChainFilter> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: &ChainFilter) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &ChainFilter) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<ChainFilter> for SerializedBytes
impl TryFrom<ChainFilter> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: ChainFilter) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: ChainFilter) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<SerializedBytes> for ChainFilter
impl TryFrom<SerializedBytes> for ChainFilter
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(sb: SerializedBytes) -> Result<ChainFilter, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<ChainFilter, SerializedBytesError>
impl<H: Eq + Eq + Ord + Hash> Eq for ChainFilter<H>
impl<H: Eq + Ord + Hash> StructuralPartialEq for ChainFilter<H>
Auto Trait Implementations§
impl<H> Freeze for ChainFilter<H>
impl<H> RefUnwindSafe for ChainFilter<H>
impl<H> Send for ChainFilter<H>
impl<H> Sync for ChainFilter<H>
impl<H> Unpin for ChainFilter<H>
impl<H> UnwindSafe for ChainFilter<H>
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<T> CallHasher for T
impl<T> CallHasher for 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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.