[][src]Enum casper_node::effect::requests::StorageRequest

#[must_use]pub enum StorageRequest<S: StorageType + 'static> {
    PutBlock {
        block: Box<S::Block>,
        responder: Responder<bool>,
    },
    GetBlock {
        block_hash: <S::Block as Value>::Id,
        responder: Responder<Option<S::Block>>,
    },
    GetBlockAtHeight {
        height: u64,
        responder: Responder<Option<S::Block>>,
    },
    GetHighestBlock {
        responder: Responder<Option<S::Block>>,
    },
    GetBlockHeader {
        block_hash: <S::Block as Value>::Id,
        responder: Responder<Option<<S::Block as Value>::Header>>,
    },
    PutDeploy {
        deploy: Box<S::Deploy>,
        responder: Responder<bool>,
    },
    GetDeploys {
        deploy_hashes: SmallVec<[<<S as StorageType>::Deploy as Value>::Id; 3]>,
        responder: Responder<SmallVec<[Option<<S as StorageType>::Deploy>; 3]>>,
    },
    GetDeployHeaders {
        deploy_hashes: SmallVec<[<<S as StorageType>::Deploy as Value>::Id; 3]>,
        responder: Responder<SmallVec<[Option<<<S as StorageType>::Deploy as Value>::Header>; 3]>>,
    },
    PutExecutionResults {
        block_hash: <S::Block as Value>::Id,
        execution_results: HashMap<<S::Deploy as Value>::Id, ExecutionResult>,
        responder: Responder<()>,
    },
    GetDeployAndMetadata {
        deploy_hash: <S::Deploy as Value>::Id,
        responder: Responder<Option<(<S as StorageType>::Deploy, DeployMetadata<<S as StorageType>::Block>)>>,
    },
    PutChainspec {
        chainspec: Box<Chainspec>,
        responder: Responder<()>,
    },
    GetChainspec {
        version: Version,
        responder: Responder<Option<Chainspec>>,
    },
}

A storage request.

Variants

PutBlock

Store given block.

Fields of PutBlock

block: Box<S::Block>

Block to be stored.

responder: Responder<bool>

Responder to call with the result. Returns true if the block was stored on this attempt or false if it was previously stored.

GetBlock

Retrieve block with given hash.

Fields of GetBlock

block_hash: <S::Block as Value>::Id

Hash of block to be retrieved.

responder: Responder<Option<S::Block>>

Responder to call with the result. Returns None is the block doesn't exist in local storage.

GetBlockAtHeight

Retrieve block with given height.

Fields of GetBlockAtHeight

height: u64

Height of the block.

responder: Responder<Option<S::Block>>

Responder.

GetHighestBlock

Retrieve highest block.

Fields of GetHighestBlock

responder: Responder<Option<S::Block>>

Responder.

GetBlockHeader

Retrieve block header with given hash.

Fields of GetBlockHeader

block_hash: <S::Block as Value>::Id

Hash of block to get header of.

responder: Responder<Option<<S::Block as Value>::Header>>

Responder to call with the result. Returns None is the block header doesn't exist in local storage.

PutDeploy

Store given deploy.

Fields of PutDeploy

deploy: Box<S::Deploy>

Deploy to store.

responder: Responder<bool>

Responder to call with the result. Returns true if the deploy was stored on this attempt or false if it was previously stored.

GetDeploys

Retrieve deploys with given hashes.

Fields of GetDeploys

deploy_hashes: SmallVec<[<<S as StorageType>::Deploy as Value>::Id; 3]>

Hashes of deploys to be retrieved.

responder: Responder<SmallVec<[Option<<S as StorageType>::Deploy>; 3]>>

Responder to call with the results.

GetDeployHeaders

Retrieve deploy headers with given hashes.

Fields of GetDeployHeaders

deploy_hashes: SmallVec<[<<S as StorageType>::Deploy as Value>::Id; 3]>

Hashes of deploy headers to be retrieved.

responder: Responder<SmallVec<[Option<<<S as StorageType>::Deploy as Value>::Header>; 3]>>

Responder to call with the results.

PutExecutionResults

Store the given execution results for the deploys in the given block.

Fields of PutExecutionResults

block_hash: <S::Block as Value>::Id

Hash of block.

execution_results: HashMap<<S::Deploy as Value>::Id, ExecutionResult>

Execution results.

responder: Responder<()>

Responder to call with the result. Returns true if the execution results were stored on this attempt or false if they were previously stored.

GetDeployAndMetadata

Retrieve deploy and its metadata.

Fields of GetDeployAndMetadata

deploy_hash: <S::Deploy as Value>::Id

Hash of deploy to be retrieved.

responder: Responder<Option<(<S as StorageType>::Deploy, DeployMetadata<<S as StorageType>::Block>)>>

Responder to call with the results.

PutChainspec

Store given chainspec.

Fields of PutChainspec

chainspec: Box<Chainspec>

Chainspec.

responder: Responder<()>

Responder to call with the result.

GetChainspec

Retrieve chainspec with given version.

Fields of GetChainspec

version: Version

Version.

responder: Responder<Option<Chainspec>>

Responder to call with the result.

Trait Implementations

impl<S: Debug + StorageType + 'static> Debug for StorageRequest<S> where
    S::Block: Debug,
    S::Block: Debug,
    S::Block: Debug,
    S::Block: Debug,
    S::Block: Debug,
    S::Block: Debug,
    S::Block: Debug,
    S::Deploy: Debug,
    S::Block: Debug,
    S::Deploy: Debug,
    S::Deploy: Debug
[src]

impl<S: StorageType> Display for StorageRequest<S>[src]

impl From<StorageRequest<LmdbStorage<Block, Deploy>>> for Event[src]

impl From<StorageRequest<LmdbStorage<Block, Deploy>>> for InitializerEvent[src]

impl From<StorageRequest<LmdbStorage<Block, Deploy>>> for Event[src]

impl From<StorageRequest<LmdbStorage<Block, Deploy>>> for Event[src]

Auto Trait Implementations

impl<S> !RefUnwindSafe for StorageRequest<S>

impl<S> Send for StorageRequest<S> where
    <S as StorageType>::Block: Send,
    <S as StorageType>::Deploy: Send,
    <<S as StorageType>::Block as Value>::Header: Send,
    <<S as StorageType>::Deploy as Value>::Header: Send,
    <<S as StorageType>::Block as Value>::Id: Send,
    <<S as StorageType>::Deploy as Value>::Id: Send

impl<S> Sync for StorageRequest<S> where
    <S as StorageType>::Block: Send + Sync,
    <S as StorageType>::Deploy: Send + Sync,
    <<S as StorageType>::Block as Value>::Header: Send,
    <<S as StorageType>::Deploy as Value>::Header: Send,
    <<S as StorageType>::Block as Value>::Id: Send + Sync,
    <<S as StorageType>::Deploy as Value>::Id: Sync

impl<S> Unpin for StorageRequest<S> where
    <<S as StorageType>::Block as Value>::Id: Unpin,
    <<S as StorageType>::Deploy as Value>::Id: Unpin

impl<S> !UnwindSafe for StorageRequest<S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromBits<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]