pub struct TransportPeer { /* private fields */ }Expand description
Forwards envelopes through a ClientTransport.
Implementations§
Source§impl TransportPeer
impl TransportPeer
Sourcepub fn new(transport: Arc<dyn ClientTransport>) -> Self
pub fn new(transport: Arc<dyn ClientTransport>) -> Self
A peer sending through transport.
Trait Implementations§
Source§impl BridgePeer for TransportPeer
impl BridgePeer for TransportPeer
Source§fn send(
&self,
envelope: Map<String, Value>,
) -> SendFuture<'_, Result<Map<String, Value>, BridgeError>>
fn send( &self, envelope: Map<String, Value>, ) -> SendFuture<'_, Result<Map<String, Value>, BridgeError>>
Delivers one request and yields the answer, under the caller’s id.
§Errors
BridgeError::Unreachable when the request could not be delivered or
its answer could not be read. A refusal from the peer is an Ok
envelope with an error member.
Source§fn notify(
&self,
envelope: Map<String, Value>,
) -> SendFuture<'_, Result<(), BridgeError>>
fn notify( &self, envelope: Map<String, Value>, ) -> SendFuture<'_, Result<(), BridgeError>>
Source§fn close(&self) -> SendFuture<'_, Result<(), BridgeError>>
fn close(&self) -> SendFuture<'_, Result<(), BridgeError>>
There is no session to end.
Source§fn take_pending(&self) -> Vec<Map<String, Value>>
fn take_pending(&self) -> Vec<Map<String, Value>>
Frames the peer received that are the answer to nothing the bridge asked. Read more
Source§fn wait_pending(&self) -> SendFuture<'static, ()>
fn wait_pending(&self) -> SendFuture<'static, ()>
Resolves once the peer may have something for
take_pending. Read moreSource§fn listen(&self) -> SendFuture<'_, Result<(), BridgeError>>
fn listen(&self) -> SendFuture<'_, Result<(), BridgeError>>
Starts delivering frames the peer pushes on its own. Read more
Source§impl Clone for TransportPeer
impl Clone for TransportPeer
Auto Trait Implementations§
impl !RefUnwindSafe for TransportPeer
impl !UnwindSafe for TransportPeer
impl Freeze for TransportPeer
impl Send for TransportPeer
impl Sync for TransportPeer
impl Unpin for TransportPeer
impl UnsafeUnpin for TransportPeer
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