pub struct HashiverseBuilder { /* private fields */ }Expand description
Builder for a Hashiverse client with sensible defaults for every
pluggable trait. See the crate-level docs for an example.
Implementations§
Source§impl HashiverseBuilder
impl HashiverseBuilder
pub fn new() -> Self
Sourcepub fn data_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn data_dir(self, dir: impl Into<PathBuf>) -> Self
Directory for the sqlite client storage and the on-disk key locker.
Default: the platform data-dir (dirs_next::data_dir()) joined with
"hashiverse". Tildes in the supplied path are expanded.
Sourcepub fn passphrase(self, passphrase: impl Into<String>) -> Self
pub fn passphrase(self, passphrase: impl Into<String>) -> Self
Passphrase used to encrypt the on-disk key locker. Empty by default.
Sourcepub fn bootstrap(self, addresses: Vec<String>) -> Self
pub fn bootstrap(self, addresses: Vec<String>) -> Self
Override the bootstrap peer list with a hand-curated set of
host:port strings. Default: DnssecBootstrapProvider, which
resolves the public seed list via DoH with DNSSEC validation.
Sourcepub async fn build_with_keyphrase(
self,
key_phrase: impl Into<String>,
) -> Result<Hashiverse>
pub async fn build_with_keyphrase( self, key_phrase: impl Into<String>, ) -> Result<Hashiverse>
Build a client by deriving the identity from key_phrase. The derived
key is stored in the on-disk locker so a subsequent run can pick it up
via HashiverseBuilder::build_from_stored_key.
Sourcepub async fn build_from_stored_key(
self,
client_id_hex: impl Into<String>,
) -> Result<Hashiverse>
pub async fn build_from_stored_key( self, client_id_hex: impl Into<String>, ) -> Result<Hashiverse>
Build a client by loading an identity previously stored in the on-disk
key locker. client_id_hex selects which stored key to use.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HashiverseBuilder
impl RefUnwindSafe for HashiverseBuilder
impl Send for HashiverseBuilder
impl Sync for HashiverseBuilder
impl Unpin for HashiverseBuilder
impl UnsafeUnpin for HashiverseBuilder
impl UnwindSafe for HashiverseBuilder
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> 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