pub struct HostedClient {
pub remote: Remote<IrohTransport<Credentials>>,
/* private fields */
}Expand description
A direct Weft connection. The application retains operation IDs, credentials, observed versions and stream checkpoints; reconnect never retries a mutation.
Fields§
§remote: Remote<IrohTransport<Credentials>>Implementations§
Source§impl HostedClient
impl HostedClient
Sourcepub async fn connect_server(
server: &str,
options: &ConnectionOptions,
) -> Result<Self>
pub async fn connect_server( server: &str, options: &ConnectionOptions, ) -> Result<Self>
Verify the application’s HTTPS descriptor trust, connect once, and discover the endpoint’s actual v2 implementation inventory.
Sourcepub async fn connect_endpoint(
address: EndpointAddr,
credential: Credentials,
timeout: Duration,
tls_ca_certificate_pem: Option<&str>,
) -> Result<Self>
pub async fn connect_endpoint( address: EndpointAddr, credential: Credentials, timeout: Duration, tls_ca_certificate_pem: Option<&str>, ) -> Result<Self>
Connect to an endpoint whose public key the application already trusts. Relay addresses are routing hints; Iroh authenticates the supplied key.
Sourcepub async fn connect_endpoint_with_description(
address: EndpointAddr,
credential: Credentials,
timeout: Duration,
tls_ca_certificate_pem: Option<&str>,
description: Option<DescribeEndpointResponse>,
) -> Result<Self>
pub async fn connect_endpoint_with_description( address: EndpointAddr, credential: Credentials, timeout: Duration, tls_ca_certificate_pem: Option<&str>, description: Option<DescribeEndpointResponse>, ) -> Result<Self>
Connect with a description authenticated and retained by the application. A mismatched description is discarded and rediscovered on this connection.
Sourcepub async fn bind_endpoint(
tls_ca_certificate_pem: Option<&str>,
) -> Result<Endpoint>
pub async fn bind_endpoint( tls_ca_certificate_pem: Option<&str>, ) -> Result<Endpoint>
Bind without routing hints so HTTPS trust discovery can run concurrently. Only verified relays are installed before connecting.
Sourcepub async fn connect_bound_endpoint(
endpoint: Endpoint,
address: EndpointAddr,
credential: Credentials,
timeout: Duration,
description: Option<DescribeEndpointResponse>,
tls_ca_certificate_pem: Option<&str>,
) -> Result<Self>
pub async fn connect_bound_endpoint( endpoint: Endpoint, address: EndpointAddr, credential: Credentials, timeout: Duration, description: Option<DescribeEndpointResponse>, tls_ca_certificate_pem: Option<&str>, ) -> Result<Self>
Finish connecting an independently bound endpoint to a verified address.
pub fn local_endpoint_id(&self) -> EndpointId
pub fn endpoint(&self) -> &Endpoint
pub fn connection(&self) -> &Connection
Sourcepub fn into_parts(
self,
) -> (Remote<IrohTransport<Credentials>>, Endpoint, Connection)
pub fn into_parts( self, ) -> (Remote<IrohTransport<Credentials>>, Endpoint, Connection)
Release the discovered remote and the live Iroh session without closing.
The caller becomes responsible for closing connection / endpoint.
Trait Implementations§
Source§impl Drop for HostedClient
impl Drop for HostedClient
Auto Trait Implementations§
impl !RefUnwindSafe for HostedClient
impl !UnwindSafe for HostedClient
impl Freeze for HostedClient
impl Send for HostedClient
impl Sync for HostedClient
impl Unpin for HostedClient
impl UnsafeUnpin for HostedClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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