Struct remoc::chmux::Sender

source ·
pub struct Sender { /* private fields */ }
Expand description

Sends byte data over a channel.

Implementations§

source§

impl Sender

source

pub fn local_port(&self) -> u32

The local port number.

source

pub fn remote_port(&self) -> u32

The remote port number.

source

pub fn chunk_size(&self) -> usize

Maximum chunk size that can be sent.

This is set by the remote endpoint.

source

pub fn max_data_size(&self) -> usize

Configured maximum data size of receiver.

This is not a limit for the sender and only provided here for advisory purposes.

source

pub async fn send(&mut self, data: Bytes) -> Result<(), SendError>

Sends data over the channel.

Waits until send space becomes available. Data is transmitted in chunks if it exceeds the maximum chunk size.

§Cancel safety

If this function is cancelled before completion, the remote endpoint will receive no data.

source

pub fn send_chunks(&mut self) -> ChunkSender<'_>

Streams a message by sending individual chunks.

source

pub fn try_send(&mut self, data: &Bytes) -> Result<(), TrySendError>

Tries to send data over the channel.

Does not wait until send space becomes available. The maximum size of data sendable by this function is limited by the total receive buffer size.

source

pub async fn connect( &mut self, ports: Vec<PortReq>, wait: bool ) -> Result<Vec<Connect>, SendError>

Sends port open requests over this port and returns the connect requests.

The receiver limits the number of ports sendable per call, see Receiver::max_ports.

source

pub fn is_closed(&self) -> bool

True, once the remote endpoint has closed its receiver.

source

pub fn closed(&self) -> Closed ⓘ

Returns a future that will resolve when the remote endpoint closes its receiver.

source

pub fn is_graceful_close_overridden(&self) -> bool

Returns whether data can be sent anyway, even if remote endpoint closed the channel gracefully.

Sending always fails if remote endpoint closed the channel non-gracefully, for example by dropping the receiver.

By default this is false.

source

pub fn set_override_graceful_close(&mut self, override_graceful_close: bool)

Sets whether data should be sent anyway, even if remote endpoint closed the channel gracefully.

Sending always fails if remote endpoint closed the channel non-gracefully, for example by dropping the receiver.

source

pub fn into_sink(self) -> SenderSink

Convert this into a sink.

source

pub fn port_allocator(&self) -> PortAllocator

Returns the port allocator of the channel multiplexer.

source

pub fn storage(&self) -> AnyStorage

Returns the arbitrary data storage of the channel multiplexer.

Trait Implementations§

source§

impl Debug for Sender

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Sender

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more