pub struct IrohTransport { /* private fields */ }Expand description
Wraps an iroh [Connection] as a Transport for RPC plane traffic.
Clone-cheap — delegates to the transport-generic SessionRpcTransport
over iroh’s web-transport session, which is itself reference-counted.
Implementations§
Source§impl IrohTransport
impl IrohTransport
Sourcepub fn new(conn: Connection) -> Self
pub fn new(conn: Connection) -> Self
Build from an already-established iroh connection on
super::iroh_substrate::ALPN_HYPRSTREAM_RPC.
Trait Implementations§
Source§impl Clone for IrohTransport
impl Clone for IrohTransport
Source§fn clone(&self) -> IrohTransport
fn clone(&self) -> IrohTransport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Transport for IrohTransport
impl Transport for IrohTransport
Source§type Sub = Pending<Result<Vec<Vec<u8>>, Error>>
type Sub = Pending<Result<Vec<Vec<u8>>, Error>>
Subscriber type for data streams (server→client).
Must yield ZMTP multipart frames as
Vec<Vec<u8>>.Source§type Pub = RpcPublishStub
type Pub = RpcPublishStub
Publisher type for control channel (client→server).
Source§fn send<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
timeout_ms: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
timeout_ms: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a request and receive a response (REQ/REP pattern). Read more
Source§fn forbids_cleartext_envelope(&self) -> bool
fn forbids_cleartext_envelope(&self) -> bool
Whether this carrier forbids cleartext request envelopes. Read more
Source§fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Self::Sub>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Self::Sub>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Subscribe to a topic (SUB pattern). Returns a stream of multipart frames.
Auto Trait Implementations§
impl Freeze for IrohTransport
impl !RefUnwindSafe for IrohTransport
impl Send for IrohTransport
impl Sync for IrohTransport
impl Unpin for IrohTransport
impl UnsafeUnpin for IrohTransport
impl !UnwindSafe for IrohTransport
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
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> 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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more