pub struct RelayCarrier { /* private fields */ }Expand description
An ordinary wire connection to the relay on its admitted relay stream.
Implementations§
Source§impl RelayCarrier
impl RelayCarrier
Sourcepub fn new(
socket: TcpStream,
stream_id: u32,
relay: MachineIdentity,
) -> Result<Self, CarrierError>
pub fn new( socket: TcpStream, stream_id: u32, relay: MachineIdentity, ) -> Result<Self, CarrierError>
Takes a connection whose relay stream has been granted and marked.
§Errors
Stream zero is reserved for connection control.
Sourcepub fn interrupt_handle(&self) -> Result<TcpStream, CarrierError>
pub fn interrupt_handle(&self) -> Result<TcpStream, CarrierError>
Interrupts a blocking receive through the same owned socket.
§Errors
The socket cannot be duplicated.
Sourcepub fn acknowledge(
&mut self,
message_id: u64,
durable_position: Option<u64>,
) -> Result<(), CarrierError>
pub fn acknowledge( &mut self, message_id: u64, durable_position: Option<u64>, ) -> Result<(), CarrierError>
Answers an imported frame; the relay carries the full receipt back.
§Errors
The carrier has ended or the ordinary connection cannot send the ack.
Sourcepub fn refuse(
&mut self,
reason_code: u16,
reason: &str,
) -> Result<(), CarrierError>
pub fn refuse( &mut self, reason_code: u16, reason: &str, ) -> Result<(), CarrierError>
Answers a named endpoint refusal on the relay stream.
§Errors
The carrier has ended or the ordinary connection cannot send the refusal.
Sourcepub fn topology(
&self,
local: MachineIdentity,
peer: MachineIdentity,
counters: LinkCounters,
) -> Link
pub fn topology( &self, local: MachineIdentity, peer: MachineIdentity, counters: LinkCounters, ) -> Link
The topology record for the endpoint’s observed relayed link.
Trait Implementations§
Source§impl Debug for RelayCarrier
impl Debug for RelayCarrier
Source§impl LinkCarrier for RelayCarrier
impl LinkCarrier for RelayCarrier
Source§fn refuse_unsolicited(&self) -> Result<(), CarrierError>
fn refuse_unsolicited(&self) -> Result<(), CarrierError>
Errors Read more
Source§fn ended(&self) -> Option<String>
fn ended(&self) -> Option<String>
The end this carrier observed, by name, once it has one: the peer’s
close reason,
wire_eof, or the failure that ended it. None while
the carrier is live.Source§fn send(&mut self, subject: &str, sealed: &[u8]) -> Result<(), CarrierError>
fn send(&mut self, subject: &str, sealed: &[u8]) -> Result<(), CarrierError>
Sends one subject and its sealed bytes. Read more
Source§fn receive(&mut self) -> Result<CarrierReceive, CarrierError>
fn receive(&mut self) -> Result<CarrierReceive, CarrierError>
Receives the next sealed bytes, or the carrier’s named end. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RelayCarrier
impl !Sync for RelayCarrier
impl !UnwindSafe for RelayCarrier
impl Freeze for RelayCarrier
impl Send for RelayCarrier
impl Unpin for RelayCarrier
impl UnsafeUnpin for RelayCarrier
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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