Skip to main content

StorageService

Trait StorageService 

Source
pub trait StorageService:
    Send
    + Sync
    + 'static {
    type GetAllStorageStream: Stream<Item = Result<StorageEntry, Status>> + Send + 'static;
    type SearchByPrefixStream: Stream<Item = Result<StorageEntry, Status>> + Send + 'static;

    // Required methods
    fn get_all_storage<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetStorageRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetAllStorageStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_storage_value<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetStorageValueRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<StorageValueResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search_by_prefix<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SearchRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SearchByPrefixStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with StorageServiceServer.

Required Associated Types§

Source

type GetAllStorageStream: Stream<Item = Result<StorageEntry, Status>> + Send + 'static

Server streaming response type for the GetAllStorage method.

Source

type SearchByPrefixStream: Stream<Item = Result<StorageEntry, Status>> + Send + 'static

Server streaming response type for the SearchByPrefix method.

Required Methods§

Source

fn get_all_storage<'life0, 'async_trait>( &'life0 self, request: Request<GetStorageRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetAllStorageStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all storage key-value pairs for a contract

Source

fn get_storage_value<'life0, 'async_trait>( &'life0 self, request: Request<GetStorageValueRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<StorageValueResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a single storage value by key

Source

fn search_by_prefix<'life0, 'async_trait>( &'life0 self, request: Request<SearchRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SearchByPrefixStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search storage by key prefix

Implementors§