pub type BlockchainReadHandle = DatabaseReadService<BlockchainReadRequest, BlockchainResponse>;
Expand description
The blockchain database read service.
Aliased Type§
struct BlockchainReadHandle { /* private fields */ }
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes
Implementations
Source§impl<Req, Res> DatabaseReadService<Req, Res>
impl<Req, Res> DatabaseReadService<Req, Res>
Sourcepub fn new(
env: Arc<ConcreteEnv>,
pool: Arc<ThreadPool>,
req_handler: impl Fn(&ConcreteEnv, Req) -> Result<Res, RuntimeError> + Send + Sync + 'static,
) -> DatabaseReadService<Req, Res>
pub fn new( env: Arc<ConcreteEnv>, pool: Arc<ThreadPool>, req_handler: impl Fn(&ConcreteEnv, Req) -> Result<Res, RuntimeError> + Send + Sync + 'static, ) -> DatabaseReadService<Req, Res>
Creates the DatabaseReadService
with the provided backing thread-pool.
Should be called once per actual database, although nothing bad will happen, cloning the DatabaseReadService
is the correct way to get multiple handles to the database.
Trait Implementations
Source§impl<Req, Res> Clone for DatabaseReadService<Req, Res>
impl<Req, Res> Clone for DatabaseReadService<Req, Res>
Source§fn clone(&self) -> DatabaseReadService<Req, Res>
fn clone(&self) -> DatabaseReadService<Req, Res>
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<Req, Res> Service<Req> for DatabaseReadService<Req, Res>
impl<Req, Res> Service<Req> for DatabaseReadService<Req, Res>
Source§type Error = RuntimeError
type Error = RuntimeError
Errors produced by the service.
Source§type Future = InfallibleOneshotReceiver<Result<<DatabaseReadService<Req, Res> as Service<Req>>::Response, RuntimeError>>
type Future = InfallibleOneshotReceiver<Result<<DatabaseReadService<Req, Res> as Service<Req>>::Response, RuntimeError>>
The future response value.
Source§fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), RuntimeError>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), RuntimeError>>
Returns
Poll::Ready(Ok(()))
when the service is able to process requests. Read more