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

#[must_use]pub enum StorageRequest {
    PutBlock {
        block: Box<Block>,
        responder: Responder<bool>,
    },
    GetBlock {
        block_hash: BlockHash,
        responder: Responder<Option<Block>>,
    },
    GetBlockAtHeight {
        height: u64,
        responder: Responder<Option<Block>>,
    },
    GetHighestBlock {
        responder: Responder<Option<Block>>,
    },
    GetBlockHeader {
        block_hash: BlockHash,
        responder: Responder<Option<BlockHeader>>,
    },
    GetBlockTransfers {
        block_hash: BlockHash,
        responder: Responder<Option<Vec<Transfer>>>,
    },
    PutDeploy {
        deploy: Box<Deploy>,
        responder: Responder<bool>,
    },
    GetDeploys {
        deploy_hashes: Multiple<DeployHash>,
        responder: Responder<Vec<Option<Deploy>>>,
    },
    GetDeployHeaders {
        deploy_hashes: Multiple<DeployHash>,
        responder: Responder<Vec<Option<DeployHeader>>>,
    },
    PutExecutionResults {
        block_hash: BlockHash,
        execution_results: HashMap<DeployHash, ExecutionResult>,
        responder: Responder<()>,
    },
    GetDeployAndMetadata {
        deploy_hash: DeployHash,
        responder: Responder<Option<(Deploy, DeployMetadata)>>,
    },
    PutChainspec {
        chainspec: Arc<Chainspec>,
        responder: Responder<()>,
    },
    GetChainspec {
        version: Version,
        responder: Responder<Option<Arc<Chainspec>>>,
    },
}

A storage request.

Variants

PutBlock

Store given block.

Fields of PutBlock

block: Box<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: BlockHash

Hash of block to be retrieved.

responder: Responder<Option<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<Block>>

Responder.

GetHighestBlock

Retrieve highest block.

Fields of GetHighestBlock

responder: Responder<Option<Block>>

Responder.

GetBlockHeader

Retrieve block header with given hash.

Fields of GetBlockHeader

block_hash: BlockHash

Hash of block to get header of.

responder: Responder<Option<BlockHeader>>

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

GetBlockTransfers

Retrieve all transfers in a block with given hash.

Fields of GetBlockTransfers

block_hash: BlockHash

Hash of block to get transfers of.

responder: Responder<Option<Vec<Transfer>>>

Responder to call with the result. Returns None is the transfers do not exist in local storage under the block_hash provided.

PutDeploy

Store given deploy.

Fields of PutDeploy

deploy: Box<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: Multiple<DeployHash>

Hashes of deploys to be retrieved.

responder: Responder<Vec<Option<Deploy>>>

Responder to call with the results.

GetDeployHeaders

Retrieve deploy headers with given hashes.

Fields of GetDeployHeaders

deploy_hashes: Multiple<DeployHash>

Hashes of deploy headers to be retrieved.

responder: Responder<Vec<Option<DeployHeader>>>

Responder to call with the results.

PutExecutionResults

Store execution results for a set of deploys of a single block.

Will return a fatal error if there are already execution results known for a specific deploy/block combination and a different result is inserted.

Inserting the same block/deploy combination multiple times with the same execution results is not an error and will silently be ignored.

Fields of PutExecutionResults

block_hash: BlockHash

Hash of block.

execution_results: HashMap<DeployHash, ExecutionResult>

Mapping of deploys to execution results of the block.

responder: Responder<()>

Responder to call when done storing.

GetDeployAndMetadata

Retrieve deploy and its metadata.

Fields of GetDeployAndMetadata

deploy_hash: DeployHash

Hash of deploy to be retrieved.

responder: Responder<Option<(Deploy, DeployMetadata)>>

Responder to call with the results.

PutChainspec

Store given chainspec.

Fields of PutChainspec

chainspec: Arc<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<Arc<Chainspec>>>

Responder to call with the result.

Trait Implementations

impl Debug for StorageRequest[src]

impl Display for StorageRequest[src]

impl From<StorageRequest> for Event[src]

impl From<StorageRequest> for InitializerEvent[src]

impl From<StorageRequest> for Event[src]

impl From<StorageRequest> for Event[src]

impl Serialize for StorageRequest[src]

Auto Trait Implementations

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> 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> Serialize for T where
    T: Serialize + ?Sized
[src]

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]