pub struct MemoryStorage { /* private fields */ }
Implementations§
Source§impl MemoryStorage
impl MemoryStorage
Trait Implementations§
Source§impl Clone for MemoryStorage
impl Clone for MemoryStorage
Source§fn clone(&self) -> MemoryStorage
fn clone(&self) -> MemoryStorage
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for MemoryStorage
impl Default for MemoryStorage
Source§impl QueryState for MemoryStorage
impl QueryState for MemoryStorage
Source§async fn query_state(
&self,
address: &ContentAddress,
key: &Key,
) -> Result<Vec<Word>>
async fn query_state( &self, address: &ContentAddress, key: &Key, ) -> Result<Vec<Word>>
Query the state of a content address.
Source§impl StateRead for MemoryStorage
impl StateRead for MemoryStorage
Source§impl StateStorage for MemoryStorage
impl StateStorage for MemoryStorage
Source§impl Storage for MemoryStorage
impl Storage for MemoryStorage
Source§async fn insert_contract(&self, signed: SignedContract) -> Result<()>
async fn insert_contract(&self, signed: SignedContract) -> Result<()>
Insert a contract with their storage layout.
Source§async fn insert_solution_into_pool(&self, solution: Solution) -> Result<()>
async fn insert_solution_into_pool(&self, solution: Solution) -> Result<()>
Add a solution to the pool of unsolved solutions.
Source§async fn move_solutions_to_solved(
&self,
block_number: u64,
block_timestamp: Duration,
solutions: &[Hash],
) -> Result<()>
async fn move_solutions_to_solved( &self, block_number: u64, block_timestamp: Duration, solutions: &[Hash], ) -> Result<()>
Move these solutions from the pool to the solved state.
Source§async fn move_solutions_to_failed(
&self,
solutions: &[(Hash, SolutionFailReason)],
) -> Result<()>
async fn move_solutions_to_failed( &self, solutions: &[(Hash, SolutionFailReason)], ) -> Result<()>
Move these solutions from the pool to the failed state.
Source§async fn get_predicate(
&self,
address: &PredicateAddress,
) -> Result<Option<Predicate>>
async fn get_predicate( &self, address: &PredicateAddress, ) -> Result<Option<Predicate>>
Get an individual predicate.
Note that the same predicate might be in multiple contracts.
Source§async fn get_contract(
&self,
address: &ContentAddress,
) -> Result<Option<SignedContract>>
async fn get_contract( &self, address: &ContentAddress, ) -> Result<Option<SignedContract>>
Get the entire contract.
Source§async fn list_contracts(
&self,
time_range: Option<Range<Duration>>,
page: Option<usize>,
) -> Result<Vec<Contract>>
async fn list_contracts( &self, time_range: Option<Range<Duration>>, page: Option<usize>, ) -> Result<Vec<Contract>>
List all contracts. This will paginate the results. The page is 0-indexed.
A time range can optionally be provided to filter the results.
The time is duration since the Unix epoch.
Source§fn subscribe_contracts(
self,
start_time: Option<Duration>,
start_page: Option<usize>,
) -> impl Stream<Item = Result<Contract>> + Send + 'static
fn subscribe_contracts( self, start_time: Option<Duration>, start_page: Option<usize>, ) -> impl Stream<Item = Result<Contract>> + Send + 'static
Subscribe to new contracts from a given start page or start time.
This will return all the contracts from that point then continue to stream
as new contracts are added.
Source§async fn list_solutions_pool(
&self,
page: Option<usize>,
) -> Result<Vec<Solution>>
async fn list_solutions_pool( &self, page: Option<usize>, ) -> Result<Vec<Solution>>
List all solutions in the pool.
Source§async fn list_failed_solutions_pool(
&self,
page: Option<usize>,
) -> Result<Vec<FailedSolution>>
async fn list_failed_solutions_pool( &self, page: Option<usize>, ) -> Result<Vec<FailedSolution>>
List all failed solutions in the pool.
Source§async fn list_blocks(
&self,
time_range: Option<Range<Duration>>,
block_number: Option<u64>,
page: Option<usize>,
) -> Result<Vec<Block>>
async fn list_blocks( &self, time_range: Option<Range<Duration>>, block_number: Option<u64>, page: Option<usize>, ) -> Result<Vec<Block>>
List all blocks of solutions that have been solved.
Source§fn subscribe_blocks(
self,
start_time: Option<Duration>,
block_number: Option<u64>,
start_page: Option<usize>,
) -> impl Stream<Item = Result<Block>> + Send + 'static
fn subscribe_blocks( self, start_time: Option<Duration>, block_number: Option<u64>, start_page: Option<usize>, ) -> impl Stream<Item = Result<Block>> + Send + 'static
Subscribe to new blocks from a given block number or start page or start time.
This will return all the blocks from that point then continue to stream
as new blocks are added.
Source§async fn get_solution(
&self,
solution_hash: Hash,
) -> Result<Option<SolutionOutcomes>>
async fn get_solution( &self, solution_hash: Hash, ) -> Result<Option<SolutionOutcomes>>
Get failed solution and its failing reason.
Source§async fn prune_failed_solutions(&self, older_than: Duration) -> Result<()>
async fn prune_failed_solutions(&self, older_than: Duration) -> Result<()>
Prune failed solutions that failed before the provided duration.
Source§fn commit_block(
&self,
data: CommitData<'_>,
) -> impl Future<Output = Result<()>> + Send
fn commit_block( &self, data: CommitData<'_>, ) -> impl Future<Output = Result<()>> + Send
Commit block data atomically.
Auto Trait Implementations§
impl Freeze for MemoryStorage
impl !RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl !UnwindSafe for MemoryStorage
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more