pub struct ClientBuilder { /* private fields */ }Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(
url: impl Into<RelayUrl>,
secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
pub fn new( url: impl Into<RelayUrl>, secret_key: SecretKey, dns_resolver: DnsResolver, ) -> Self
Create a new ClientBuilder
Sourcepub fn address_family_selector<S>(self, selector: S) -> Self
pub fn address_family_selector<S>(self, selector: S) -> Self
Returns if we should prefer ipv6 it replaces the relayhttp.AddressFamilySelector we pass It provides the hint as to whether in an IPv4-vs-IPv6 race that IPv4 should be held back a bit to give IPv6 a better-than-50/50 chance of winning. We only return true when we believe IPv6 will work anyway, so we don’t artificially delay the connection speed.
Sourcepub fn insecure_skip_cert_verify(self, skip: bool) -> Self
Available on crate features test-utils only.
pub fn insecure_skip_cert_verify(self, skip: bool) -> Self
test-utils only.Skip the verification of the relay server’s SSL certificates.
May only be used in tests.
Sourcepub fn proxy_url(self, url: Url) -> Self
pub fn proxy_url(self, url: Url) -> Self
Set an explicit proxy url to proxy all HTTP(S) traffic through.
Sourcepub fn key_cache_capacity(self, capacity: usize) -> Self
pub fn key_cache_capacity(self, capacity: usize) -> Self
Set the capacity of the cache for public keys.
Sourcepub async fn connect(&self) -> Result<Client, ConnectError>
Available on non-wasm_browser only.
pub async fn connect(&self) -> Result<Client, ConnectError>
wasm_browser only.Establishes a new connection to the relay server.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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