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_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>
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,
pub async fn fetch_record(
&mut self,
hash: AnyDhtHash,
options: NetworkGetOptions
) -> CascadeResult<()>
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.
pub async fn get_entry_details(
&mut self,
entry_hash: EntryHash,
options: GetOptions
) -> CascadeResult<Option<EntryDetails>>
pub async fn get_action_details(
&mut self,
action_hash: ActionHash,
options: GetOptions
) -> CascadeResult<Option<RecordDetails>>
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.
pub async fn get_concurrent<I: IntoIterator<Item = AnyDhtHash>>(
&mut self,
hashes: I,
options: GetOptions
) -> CascadeResult<Vec<Option<Record>>>
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.
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<(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 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)
sourcepub fn get_validation_package_local(
&self,
_hash: &ActionHash
) -> CascadeResult<Option<Vec<Record>>>
pub fn get_validation_package_local(
&self,
_hash: &ActionHash
) -> CascadeResult<Option<Vec<Record>>>
Get the validation package if it is cached without going to the network
pub async fn get_validation_package(
&mut self,
_agent: AgentPubKey,
_action: &ActionHashed
) -> 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
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.
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<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
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>
Deserializes using the given deserializer
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
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if 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
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
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