Trait sc_service::RpcExtensionBuilder [−][src]
pub trait RpcExtensionBuilder { type Output: RpcExtension<Metadata>; fn build(
&self,
deny: DenyUnsafe,
subscription_executor: SubscriptionTaskExecutor
) -> Result<Self::Output, Error>; }
Expand description
A utility trait for building an RPC extension given a DenyUnsafe
instance.
This is useful since at service definition time we don’t know whether the
specific interface where the RPC extension will be exposed is safe or not.
This trait allows us to lazily build the RPC extension whenever we bind the
service to an interface.
Associated Types
Required methods
fn build(
&self,
deny: DenyUnsafe,
subscription_executor: SubscriptionTaskExecutor
) -> Result<Self::Output, Error>
fn build(
&self,
deny: DenyUnsafe,
subscription_executor: SubscriptionTaskExecutor
) -> Result<Self::Output, Error>
Returns an instance of the RPC extension for a particular DenyUnsafe
value, e.g. the RPC extension might not expose some unsafe methods.
Implementors
impl<F, R> RpcExtensionBuilder for F where
F: Fn(DenyUnsafe, SubscriptionTaskExecutor) -> Result<R, Error>,
R: RpcExtension<Metadata>,
impl<R> RpcExtensionBuilder for NoopRpcExtensionBuilder<R> where
R: Clone + RpcExtension<Metadata>,