pub struct OnlineBlobProviderBuilder<B: BeaconClient, F: BlobSidecarProvider> { /* private fields */ }
Expand description
A builder for a OnlineBlobProviderWithFallback instance.
This builder allows for the construction of a blob provider that uses a primary beacon node and can fallback to a secondary BlobSidecarProvider if the primary fails to fetch blob sidecars.
The fallback provider is optional and can be set using the Self::with_fallback method.
Two convenience methods are available for initializing the providers from beacon client URLs:
- Self::with_primary for the primary beacon client.
- Self::with_fallback for the fallback beacon client.
Implementations§
Source§impl<B: BeaconClient, F: BlobSidecarProvider> OnlineBlobProviderBuilder<B, F>
impl<B: BeaconClient, F: BlobSidecarProvider> OnlineBlobProviderBuilder<B, F>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new OnlineBlobProviderBuilder.
Sourcepub fn with_beacon_client(self, beacon_client: B) -> Self
pub fn with_beacon_client(self, beacon_client: B) -> Self
Adds a primary beacon client to the builder. This is required.
Sourcepub const fn with_genesis_time(self, genesis_time: u64) -> Self
pub const fn with_genesis_time(self, genesis_time: u64) -> Self
Adds a genesis time to the builder. This is optional.
Sourcepub const fn with_slot_interval(self, slot_interval: u64) -> Self
pub const fn with_slot_interval(self, slot_interval: u64) -> Self
Adds a slot interval to the builder. This is optional.
Sourcepub fn with_fallback_provider(self, fallback: F) -> Self
pub fn with_fallback_provider(self, fallback: F) -> Self
Adds a fallback blob provider to the builder. This is optional.
Sourcepub fn build(self) -> OnlineBlobProviderWithFallback<B, F>
pub fn build(self) -> OnlineBlobProviderWithFallback<B, F>
Builds the OnlineBlobProviderWithFallback instance.
Source§impl<F: BlobSidecarProvider> OnlineBlobProviderBuilder<OnlineBeaconClient, F>
impl<F: BlobSidecarProvider> OnlineBlobProviderBuilder<OnlineBeaconClient, F>
Sourcepub fn with_primary(self, url: String) -> Self
pub fn with_primary(self, url: String) -> Self
Adds a primary OnlineBeaconClient to the builder using the specified HTTP URL.
Source§impl<B: BeaconClient + Send + Sync> OnlineBlobProviderBuilder<B, OnlineBeaconClient>
impl<B: BeaconClient + Send + Sync> OnlineBlobProviderBuilder<B, OnlineBeaconClient>
Sourcepub fn with_fallback(self, maybe_url: Option<String>) -> Self
pub fn with_fallback(self, maybe_url: Option<String>) -> Self
Adds a fallback OnlineBeaconClient to the builder using the specified HTTP URL.
Trait Implementations§
Source§impl<B: Clone + BeaconClient, F: Clone + BlobSidecarProvider> Clone for OnlineBlobProviderBuilder<B, F>
impl<B: Clone + BeaconClient, F: Clone + BlobSidecarProvider> Clone for OnlineBlobProviderBuilder<B, F>
Source§fn clone(&self) -> OnlineBlobProviderBuilder<B, F>
fn clone(&self) -> OnlineBlobProviderBuilder<B, F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<B: Debug + BeaconClient, F: Debug + BlobSidecarProvider> Debug for OnlineBlobProviderBuilder<B, F>
impl<B: Debug + BeaconClient, F: Debug + BlobSidecarProvider> Debug for OnlineBlobProviderBuilder<B, F>
Source§impl<B: BeaconClient, F: BlobSidecarProvider> Default for OnlineBlobProviderBuilder<B, F>
impl<B: BeaconClient, F: BlobSidecarProvider> Default for OnlineBlobProviderBuilder<B, F>
Source§impl<B: BeaconClient, F: BlobSidecarProvider> From<OnlineBlobProviderBuilder<B, F>> for OnlineBlobProviderWithFallback<B, F>
impl<B: BeaconClient, F: BlobSidecarProvider> From<OnlineBlobProviderBuilder<B, F>> for OnlineBlobProviderWithFallback<B, F>
Source§fn from(builder: OnlineBlobProviderBuilder<B, F>) -> Self
fn from(builder: OnlineBlobProviderBuilder<B, F>) -> Self
Auto Trait Implementations§
impl<B, F> Freeze for OnlineBlobProviderBuilder<B, F>
impl<B, F> RefUnwindSafe for OnlineBlobProviderBuilder<B, F>where
B: RefUnwindSafe,
F: RefUnwindSafe,
impl<B, F> Send for OnlineBlobProviderBuilder<B, F>
impl<B, F> Sync for OnlineBlobProviderBuilder<B, F>
impl<B, F> Unpin for OnlineBlobProviderBuilder<B, F>
impl<B, F> UnwindSafe for OnlineBlobProviderBuilder<B, F>where
B: UnwindSafe,
F: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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