Struct holochain_cascade::Cascade
source · [−]pub struct Cascade<Network = HolochainP2pDna> { /* private fields */ }
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_env: DbWrite<DbKindCache>
) -> Cascade<N>
pub fn with_network<N: HolochainP2pDnaT + Clone>(
self,
network: N,
cache_env: DbWrite<DbKindCache>
) -> Cascade<N>
Add the network and cache to the cascade.
sourceimpl Cascade<HolochainP2pDna>
impl Cascade<HolochainP2pDna>
pub fn from_workspace_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(
stores: HostFnStores,
author: Option<Arc<AgentPubKey>>
) -> Self
sourceimpl<Network> Cascade<Network> where
Network: HolochainP2pDnaT + Clone + 'static + Send,
impl<Network> Cascade<Network> where
Network: HolochainP2pDnaT + Clone + 'static + Send,
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_header(
&mut self,
hash: HeaderHash,
options: NetworkGetOptions
) -> CascadeResult<Option<SignedHeaderHashed>>
pub async fn retrieve_header(
&mut self,
hash: HeaderHash,
options: NetworkGetOptions
) -> CascadeResult<Option<SignedHeaderHashed>>
Retrieve SignedHeaderHashed
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<Element>>
pub async fn retrieve(
&mut self,
hash: AnyDhtHash,
options: NetworkGetOptions
) -> CascadeResult<Option<Element>>
Retrieve data from either locally or from an authority. Data might not have been validated yet by the authority.
pub async fn get_entry_details(
&mut self,
entry_hash: EntryHash,
options: GetOptions
) -> CascadeResult<Option<EntryDetails>>
pub async fn get_header_details(
&mut self,
header_hash: HeaderHash,
options: GetOptions
) -> CascadeResult<Option<ElementDetails>>
sourcepub async fn dht_get_header(
&mut self,
header_hash: HeaderHash,
options: GetOptions
) -> CascadeResult<Option<Element>>
pub async fn dht_get_header(
&mut self,
header_hash: HeaderHash,
options: GetOptions
) -> CascadeResult<Option<Element>>
Returns the Element for this HeaderHash if it is live by getting the latest available metadata from authorities combined with this agents authored data. Note: Deleted headers are a tombstone set
sourcepub async fn dht_get_entry(
&mut self,
entry_hash: EntryHash,
options: GetOptions
) -> CascadeResult<Option<Element>>
pub async fn dht_get_entry(
&mut self,
entry_hash: EntryHash,
options: GetOptions
) -> CascadeResult<Option<Element>>
pub async fn get_concurrent<I: IntoIterator<Item = AnyDhtHash>>(
&mut self,
hashes: I,
options: GetOptions
) -> CascadeResult<Vec<Option<Element>>>
sourcepub async fn dht_get(
&mut self,
hash: AnyDhtHash,
options: GetOptions
) -> CascadeResult<Option<Element>>
pub async fn dht_get(
&mut self,
hash: AnyDhtHash,
options: GetOptions
) -> CascadeResult<Option<Element>>
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.
pub async fn get_details(
&mut self,
hash: AnyDhtHash,
options: GetOptions
) -> CascadeResult<Option<Details>>
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<(SignedHeaderHashed, Vec<SignedHeaderHashed>)>>
pub async fn get_link_details(
&mut self,
key: WireLinkKey,
options: GetLinksOptions
) -> CascadeResult<Vec<(SignedHeaderHashed, Vec<SignedHeaderHashed>)>>
Return all CreateLink headers and DeleteLink headers ordered by time.
sourcepub async fn get_agent_activity(
&mut self,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> CascadeResult<AgentActivityResponse<Element>>
pub async fn get_agent_activity(
&mut self,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> CascadeResult<AgentActivityResponse<Element>>
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_headers will fetch the valid headers in parallel (requires include_valid_activity) Query:
- include_entries will also fetch the entries in parallel (requires include_full_headers)
- sequence_range will get all the activity in the exclusive range
- header_type and entry_type will filter the activity (requires include_full_headers)
sourcepub fn get_validation_package_local(
&self,
_hash: &HeaderHash
) -> CascadeResult<Option<Vec<Element>>>
pub fn get_validation_package_local(
&self,
_hash: &HeaderHash
) -> CascadeResult<Option<Vec<Element>>>
Get the validation package if it is cached without going to the network
pub async fn get_validation_package(
&mut self,
_agent: AgentPubKey,
_header: &HeaderHashed
) -> CascadeResult<Option<ValidationPackage>>
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 T where
T: Any + ?Sized,
impl<T> Any for T where
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745 Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more