Struct holochain_cascade::MockCascade
source · pub struct MockCascade { /* private fields */ }
Expand description
TODO
Implementations§
source§impl MockCascade
impl MockCascade
sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new
method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new
method can still be called
like <MockX as TraitY>::new
source§impl MockCascade
impl MockCascade
sourcepub fn expect_retrieve_entry(&mut self) -> &mut Expectation<'static>
pub fn expect_retrieve_entry(&mut self) -> &mut Expectation<'static>
Create an Expectation
for mocking the retrieve_entry
method
sourcepub fn expect_retrieve_action(&mut self) -> &mut Expectation<'static>
pub fn expect_retrieve_action(&mut self) -> &mut Expectation<'static>
Create an Expectation
for mocking the retrieve_action
method
sourcepub fn expect_retrieve(&mut self) -> &mut Expectation<'static>
pub fn expect_retrieve(&mut self) -> &mut Expectation<'static>
Create an Expectation
for mocking the retrieve
method
source§impl MockCascade
impl MockCascade
sourcepub fn with_records(records: Vec<Record>) -> Self
pub fn with_records(records: Vec<Record>) -> Self
Construct a mock which acts as if the given records were part of local storage
Trait Implementations§
source§impl Cascade for MockCascade
impl Cascade for MockCascade
TODO
source§fn retrieve_entry<'life0, 'async_trait>(
&'life0 self,
hash: EntryHash,
options: NetworkGetOptions
) -> Pin<Box<dyn Future<Output = CascadeResult<Option<(EntryHashed, CascadeSource)>>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn retrieve_entry<'life0, 'async_trait>(
&'life0 self,
hash: EntryHash,
options: NetworkGetOptions
) -> Pin<Box<dyn Future<Output = CascadeResult<Option<(EntryHashed, CascadeSource)>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Retrieve [Entry
] either locally or from an authority.
Data might not have been validated yet by the authority.
source§fn retrieve_action<'life0, 'async_trait>(
&'life0 self,
hash: ActionHash,
options: NetworkGetOptions
) -> Pin<Box<dyn Future<Output = CascadeResult<Option<(SignedActionHashed, CascadeSource)>>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn retrieve_action<'life0, 'async_trait>(
&'life0 self,
hash: ActionHash,
options: NetworkGetOptions
) -> Pin<Box<dyn Future<Output = CascadeResult<Option<(SignedActionHashed, CascadeSource)>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Retrieve [SignedActionHashed
] from either locally or from an authority.
Data might not have been validated yet by the authority.
source§fn retrieve<'life0, 'async_trait>(
&'life0 self,
hash: AnyDhtHash,
options: NetworkGetOptions
) -> Pin<Box<dyn Future<Output = CascadeResult<Option<(Record, CascadeSource)>>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn retrieve<'life0, 'async_trait>(
&'life0 self,
hash: AnyDhtHash,
options: NetworkGetOptions
) -> Pin<Box<dyn Future<Output = CascadeResult<Option<(Record, CascadeSource)>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Retrieve data from either locally or from an authority. Data might not have been validated yet by the authority.
source§impl Debug for MockCascade
impl Debug for MockCascade
Auto Trait Implementations§
impl RefUnwindSafe for MockCascade
impl Send for MockCascade
impl Sync for MockCascade
impl Unpin for MockCascade
impl UnwindSafe for MockCascade
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§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
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§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>
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>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§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 more§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).§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.