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 protocol(self, protocol: Protocol) -> Self
pub fn protocol(self, protocol: Protocol) -> Self
Sets whether to connect to the relay via websockets or not. Set to use non-websocket, normal relaying by default.
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 feature 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.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a copy 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