Struct holochain_cascade::Cascade
source · [−]pub struct Cascade<Network = HolochainP2pDna> { /* private fields */ }
Expand description
The Cascade is a multi-tiered accessor for Holochain DHT data.
See the module-level docs for more info.
Implementations
sourceimpl<Network> Cascade<Network>where
Network: HolochainP2pDnaT + Clone + 'static + Send,
impl<Network> Cascade<Network>where
Network: HolochainP2pDnaT + Clone + 'static + Send,
Add the authored env to the cascade.
sourcepub fn with_private_data(self, author: Arc<AgentPubKey>) -> Self
pub fn with_private_data(self, author: Arc<AgentPubKey>) -> Self
Add the ability to access private entries for this agent.
sourcepub fn with_cache(self, cache: DbWrite<DbKindCache>) -> Self
pub fn with_cache(self, cache: DbWrite<DbKindCache>) -> Self
Add the cache to the cascade.
sourcepub fn with_scratch(self, scratch: SyncScratch) -> Self
pub fn with_scratch(self, scratch: SyncScratch) -> Self
Add the cache to the cascade.
sourcepub fn with_network<N: HolochainP2pDnaT + Clone>(
self,
network: N,
cache_db: DbWrite<DbKindCache>
) -> Cascade<N>
pub fn with_network<N: HolochainP2pDnaT + Clone>(
self,
network: N,
cache_db: DbWrite<DbKindCache>
) -> Cascade<N>
Add the network and cache to the cascade.
sourceimpl Cascade<HolochainP2pDna>
impl Cascade<HolochainP2pDna>
sourcepub fn from_workspace_and_network<N, AuthorDb, DhtDb>(
workspace: &HostFnWorkspace<AuthorDb, DhtDb>,
network: N
) -> Cascade<N>where
N: HolochainP2pDnaT + Clone,
AuthorDb: ReadAccess<DbKindAuthored>,
DhtDb: ReadAccess<DbKindDht>,
pub fn from_workspace_and_network<N, AuthorDb, DhtDb>(
workspace: &HostFnWorkspace<AuthorDb, DhtDb>,
network: N
) -> Cascade<N>where
N: HolochainP2pDnaT + Clone,
AuthorDb: ReadAccess<DbKindAuthored>,
DhtDb: ReadAccess<DbKindDht>,
Construct a Cascade with network access
sourcepub fn from_workspace_stores(
stores: HostFnStores,
author: Option<Arc<AgentPubKey>>
) -> Self
pub fn from_workspace_stores(
stores: HostFnStores,
author: Option<Arc<AgentPubKey>>
) -> Self
Construct a Cascade with local-only access to the provided stores
sourceimpl<Network> Cascade<Network>where
Network: HolochainP2pDnaT + Clone + 'static + Send,
impl<Network> Cascade<Network>where
Network: HolochainP2pDnaT + Clone + 'static + Send,
sourcepub async fn fetch_record(
&mut self,
hash: AnyDhtHash,
options: NetworkGetOptions
) -> CascadeResult<()>
pub async fn fetch_record(
&mut self,
hash: AnyDhtHash,
options: NetworkGetOptions
) -> CascadeResult<()>
Fetch a Record from the network, caching and returning the results
sourcepub async fn retrieve_entry(
&mut self,
hash: EntryHash,
options: NetworkGetOptions
) -> CascadeResult<Option<EntryHashed>>
pub async fn retrieve_entry(
&mut self,
hash: EntryHash,
options: NetworkGetOptions
) -> CascadeResult<Option<EntryHashed>>
Retrieve [Entry
] from either locally or from an authority.
Data might not have been validated yet by the authority.
sourcepub async fn retrieve_action(
&mut self,
hash: ActionHash,
options: NetworkGetOptions
) -> CascadeResult<Option<SignedActionHashed>>
pub async fn retrieve_action(
&mut self,
hash: ActionHash,
options: NetworkGetOptions
) -> CascadeResult<Option<SignedActionHashed>>
Retrieve [SignedActionHashed
] from either locally or from an authority.
Data might not have been validated yet by the authority.
sourcepub async fn retrieve(
&mut self,
hash: AnyDhtHash,
options: NetworkGetOptions
) -> CascadeResult<Option<Record>>
pub async fn retrieve(
&mut self,
hash: AnyDhtHash,
options: NetworkGetOptions
) -> CascadeResult<Option<Record>>
Retrieve data from either locally or from an authority. Data might not have been validated yet by the authority.
sourcepub async fn get_entry_details(
&mut self,
entry_hash: EntryHash,
options: GetOptions
) -> CascadeResult<Option<EntryDetails>>
pub async fn get_entry_details(
&mut self,
entry_hash: EntryHash,
options: GetOptions
) -> CascadeResult<Option<EntryDetails>>
Get Entry data along with all CRUD actions associated with it.
Also returns Rejected actions, which may affect the interpreted validity status of this Entry.
sourcepub async fn get_record_details(
&mut self,
action_hash: ActionHash,
options: GetOptions
) -> CascadeResult<Option<RecordDetails>>
pub async fn get_record_details(
&mut self,
action_hash: ActionHash,
options: GetOptions
) -> CascadeResult<Option<RecordDetails>>
Get the specified Record along with all Updates and Deletes associated with it.
Can return a Rejected Record.
sourcepub async fn dht_get_action(
&mut self,
action_hash: ActionHash,
options: GetOptions
) -> CascadeResult<Option<Record>>
pub async fn dht_get_action(
&mut self,
action_hash: ActionHash,
options: GetOptions
) -> CascadeResult<Option<Record>>
Returns the [Record] for this ActionHash if it is live by getting the latest available metadata from authorities combined with this agents authored data. Note: Deleted actions are a tombstone set
sourcepub async fn dht_get_entry(
&mut self,
entry_hash: EntryHash,
options: GetOptions
) -> CascadeResult<Option<Record>>
pub async fn dht_get_entry(
&mut self,
entry_hash: EntryHash,
options: GetOptions
) -> CascadeResult<Option<Record>>
Returns the oldest live [Record] for this EntryHash by getting the latest available metadata from authorities combined with this agents authored data.
sourcepub async fn get_concurrent<I: IntoIterator<Item = AnyDhtHash>>(
&mut self,
hashes: I,
options: GetOptions
) -> CascadeResult<Vec<Option<Record>>>
pub async fn get_concurrent<I: IntoIterator<Item = AnyDhtHash>>(
&mut self,
hashes: I,
options: GetOptions
) -> CascadeResult<Vec<Option<Record>>>
Perform a concurrent get
on multiple hashes simultaneously, returning
the resulting list of Records in the order that they come in
(NOT the order in which they were requested!).
sourcepub async fn dht_get(
&mut self,
hash: AnyDhtHash,
options: GetOptions
) -> CascadeResult<Option<Record>>
pub async fn dht_get(
&mut self,
hash: AnyDhtHash,
options: GetOptions
) -> CascadeResult<Option<Record>>
Updates the cache with the latest network authority data and returns what is in the cache. This gives you the latest possible picture of the current dht state. Data from your zome call is also added to the cache.
sourcepub async fn get_details(
&mut self,
hash: AnyDhtHash,
options: GetOptions
) -> CascadeResult<Option<Details>>
pub async fn get_details(
&mut self,
hash: AnyDhtHash,
options: GetOptions
) -> CascadeResult<Option<Details>>
Get either EntryDetails
or RecordDetails
, depending on the hash provided
sourcepub async fn dht_get_links(
&mut self,
key: WireLinkKey,
options: GetLinksOptions
) -> CascadeResult<Vec<Link>>
pub async fn dht_get_links(
&mut self,
key: WireLinkKey,
options: GetLinksOptions
) -> CascadeResult<Vec<Link>>
Gets an links from the cas or cache depending on it’s metadata
sourcepub async fn get_link_details(
&mut self,
key: WireLinkKey,
options: GetLinksOptions
) -> CascadeResult<Vec<(SignedActionHashed, Vec<SignedActionHashed>)>>
pub async fn get_link_details(
&mut self,
key: WireLinkKey,
options: GetLinksOptions
) -> CascadeResult<Vec<(SignedActionHashed, Vec<SignedActionHashed>)>>
Return all CreateLink actions and DeleteLink actions ordered by time.
sourcepub async fn must_get_agent_activity(
&mut self,
author: AgentPubKey,
filter: ChainFilter
) -> CascadeResult<MustGetAgentActivityResponse>
pub async fn must_get_agent_activity(
&mut self,
author: AgentPubKey,
filter: ChainFilter
) -> CascadeResult<MustGetAgentActivityResponse>
Request a hash bounded chain query.
sourcepub async fn get_agent_activity(
&mut self,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> CascadeResult<AgentActivityResponse<Record>>
pub async fn get_agent_activity(
&mut self,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> CascadeResult<AgentActivityResponse<Record>>
Get agent activity from agent activity authorities. Hashes are requested from the authority and cache for valid chains. Options:
- include_valid_activity will include the valid chain hashes.
- include_rejected_activity will include the invalid chain hashes.
- include_full_actions will fetch the valid actions in parallel (requires include_valid_activity) Query:
- include_entries will also fetch the entries in parallel (requires include_full_actions)
- sequence_range will get all the activity in the exclusive range
- action_type and entry_type will filter the activity (requires include_full_actions)
Trait Implementations
Auto Trait Implementations
impl<Network = HolochainP2pDna> !RefUnwindSafe for Cascade<Network>
impl<Network> Send for Cascade<Network>where
Network: Send,
impl<Network> Sync for Cascade<Network>where
Network: Sync,
impl<Network> Unpin for Cascade<Network>where
Network: Unpin,
impl<Network = HolochainP2pDna> !UnwindSafe for Cascade<Network>
Blanket Implementations
impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn 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).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.