pub struct CombinedBackendBuilder<T: Config> { /* private fields */ }Expand description
A builder to configure and build a CombinedBackend.
Implementations§
Source§impl<T: Config> CombinedBackendBuilder<T>
impl<T: Config> CombinedBackendBuilder<T>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new CombinedBackendBuilder.
Sourcepub fn with_archive_backend(self, backend: ArchiveBackend<T>) -> Self
pub fn with_archive_backend(self, backend: ArchiveBackend<T>) -> Self
Use the given ArchiveBackend where applicable.
Sourcepub fn with_chainhead_backend(self, backend: ChainHeadBackend<T>) -> Self
pub fn with_chainhead_backend(self, backend: ChainHeadBackend<T>) -> Self
Use the given ChainHeadBackend where applicable.
Sourcepub fn with_legacy_backend(self, backend: LegacyBackend<T>) -> Self
pub fn with_legacy_backend(self, backend: LegacyBackend<T>) -> Self
Use the given LegacyBackend where applicable.
Sourcepub fn no_default_backends(self) -> Self
pub fn no_default_backends(self) -> Self
Don’t use any default backends; only use what is explicitly configured via
CombinedBackendBuilder::with_archive_backend,
CombinedBackendBuilder::with_chainhead_backend and
CombinedBackendBuilder::with_legacy_backend.
Sourcepub async fn build(
self,
rpc_client: impl Into<RpcClient>,
) -> Result<(CombinedBackend<T>, CombinedBackendDriver<T>), CombinedBackendError>
pub async fn build( self, rpc_client: impl Into<RpcClient>, ) -> Result<(CombinedBackend<T>, CombinedBackendDriver<T>), CombinedBackendError>
A low-level API to build the backend and driver which requires polling the driver for the backend to make progress.
This is useful if you want to manage the driver yourself, for example if you want to run it in on a specific runtime.
If you just want to run the driver in the background until completion in on the default runtime,
use CombinedBackendBuilder::build_with_background_driver instead.
Sourcepub async fn build_with_background_driver(
self,
client: impl Into<RpcClient>,
) -> Result<CombinedBackend<T>, CombinedBackendError>
pub async fn build_with_background_driver( self, client: impl Into<RpcClient>, ) -> Result<CombinedBackend<T>, CombinedBackendError>
An API to build the backend and driver which will run in the background until completion on the default runtime.
- On non-wasm targets, this will spawn the driver on
tokio. - On wasm targets, this will spawn the driver on
wasm-bindgen-futures.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for CombinedBackendBuilder<T>
impl<T> !UnwindSafe for CombinedBackendBuilder<T>
impl<T> Freeze for CombinedBackendBuilder<T>where
BackendChoice<ArchiveBackend<T>>: Freeze,
BackendChoice<ChainHeadBackend<T>>: Freeze,
BackendChoice<LegacyBackend<T>>: Freeze,
impl<T> Send for CombinedBackendBuilder<T>where
BackendChoice<ArchiveBackend<T>>: Send,
BackendChoice<ChainHeadBackend<T>>: Send,
BackendChoice<LegacyBackend<T>>: Send,
impl<T> Sync for CombinedBackendBuilder<T>where
BackendChoice<ArchiveBackend<T>>: Sync,
BackendChoice<ChainHeadBackend<T>>: Sync,
BackendChoice<LegacyBackend<T>>: Sync,
impl<T> Unpin for CombinedBackendBuilder<T>where
BackendChoice<ArchiveBackend<T>>: Unpin,
BackendChoice<ChainHeadBackend<T>>: Unpin,
BackendChoice<LegacyBackend<T>>: Unpin,
impl<T> UnsafeUnpin for CombinedBackendBuilder<T>where
BackendChoice<ArchiveBackend<T>>: UnsafeUnpin,
BackendChoice<ChainHeadBackend<T>>: UnsafeUnpin,
BackendChoice<LegacyBackend<T>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more