pub struct ClientBuilder { /* private fields */ }Expand description
Builder than can be used to create a Client easily or with custom dependencies.
Implementations§
Source§impl ClientBuilder
 
impl ClientBuilder
Sourcepub fn aggregator(
    endpoint: &str,
    genesis_verification_key: &str,
) -> ClientBuilder
 
pub fn aggregator( endpoint: &str, genesis_verification_key: &str, ) -> ClientBuilder
Constructs a new ClientBuilder that fetches data from the aggregator at the given
endpoint and with the given genesis verification key.
Sourcepub fn new(genesis_verification_key: &str) -> ClientBuilder
 👎Deprecated since 0.12.33: Will be removed in 0.13.0
pub fn new(genesis_verification_key: &str) -> ClientBuilder
Constructs a new ClientBuilder without any dependency set.
Use ClientBuilder::aggregator if you don’t need to set a custom AggregatorClient to request data from the aggregator.
Sourcepub fn build(self) -> MithrilResult<Client>
 
pub fn build(self) -> MithrilResult<Client>
Returns a Client that uses the dependencies provided to this ClientBuilder.
The builder will try to create the missing dependencies using default implementations if possible.
Sourcepub fn with_aggregator_client(
    self,
    aggregator_client: Arc<dyn AggregatorClient>,
) -> ClientBuilder
 👎Deprecated since 0.12.33: Will be removed in 0.13.0
pub fn with_aggregator_client( self, aggregator_client: Arc<dyn AggregatorClient>, ) -> ClientBuilder
Set the AggregatorClient that will be used to request data to the aggregator.
Sourcepub fn with_era_fetcher(self, era_fetcher: Arc<dyn EraFetcher>) -> ClientBuilder
 
pub fn with_era_fetcher(self, era_fetcher: Arc<dyn EraFetcher>) -> ClientBuilder
Sets the EraFetcher that will be used by the client to retrieve the current Mithril era.
Sourcepub fn with_certificate_verifier(
    self,
    certificate_verifier: Arc<dyn CertificateVerifier>,
) -> ClientBuilder
 
pub fn with_certificate_verifier( self, certificate_verifier: Arc<dyn CertificateVerifier>, ) -> ClientBuilder
Set the CertificateVerifier that will be used to validate certificates.
Sourcepub fn with_certificate_verifier_cache(
    self,
    certificate_verifier_cache: Option<Arc<dyn CertificateVerifierCache>>,
) -> ClientBuilder
 
pub fn with_certificate_verifier_cache( self, certificate_verifier_cache: Option<Arc<dyn CertificateVerifierCache>>, ) -> ClientBuilder
Set the CertificateVerifierCache that will be used to cache certificate validation results.
Passing a None value will disable the cache if any was previously set.
Sourcepub fn with_http_file_downloader(
    self,
    http_file_downloader: Arc<dyn FileDownloader>,
) -> ClientBuilder
 
pub fn with_http_file_downloader( self, http_file_downloader: Arc<dyn FileDownloader>, ) -> ClientBuilder
Set the FileDownloader that will be used to download artifacts with HTTP.
Sourcepub fn set_ancillary_verification_key<T: Into<Option<String>>>(
    self,
    ancillary_verification_key: T,
) -> ClientBuilder
 
pub fn set_ancillary_verification_key<T: Into<Option<String>>>( self, ancillary_verification_key: T, ) -> ClientBuilder
Set the ancillary verification key to use when verifying the downloaded ancillary files.
Sourcepub fn with_logger(self, logger: Logger) -> Self
 
pub fn with_logger(self, logger: Logger) -> Self
Set the [Logger] to use.
Sourcepub fn with_origin_tag(self, origin_tag: Option<String>) -> Self
 
pub fn with_origin_tag(self, origin_tag: Option<String>) -> Self
Set the origin tag.
Sourcepub fn with_client_type(self, client_type: Option<String>) -> Self
 
pub fn with_client_type(self, client_type: Option<String>) -> Self
Set the client type.
Sourcepub fn with_options(self, options: ClientOptions) -> Self
 
pub fn with_options(self, options: ClientOptions) -> Self
Sets the options to be used by the client.
Sourcepub fn add_feedback_receiver(self, receiver: Arc<dyn FeedbackReceiver>) -> Self
 
pub fn add_feedback_receiver(self, receiver: Arc<dyn FeedbackReceiver>) -> Self
Add a feedback receiver to receive events for tasks that can have a long duration (ie: snapshot download or a long certificate chain validation).
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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> CheckedAs for T
 
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
    T: CheckedCast<Dst>,
 
fn checked_as<Dst>(self) -> Option<Dst>where
    T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
    Src: CheckedCast<Dst>,
 
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
    Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
 
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Instrument for T
 
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
 
fn instrument(self, span: Span) -> 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