Struct remoc::chmux::Receiver

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

Receives byte data over a channel.

Implementations§

source§

impl Receiver

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 max_data_size(&self) -> usize

Maximum data size in bytes to receive per message.

The default value is specified by Cfg::max_data_size.

recv_chunk is not affected by this limit.

source

pub fn set_max_data_size(&mut self, max_data_size: usize)

Set maximum data size in bytes to receive per message.

recv_chunk is not affected by this limit.

source

pub fn max_ports(&self) -> usize

Maximum port count per message.

The default value is specified by Cfg::max_received_ports.

source

pub fn set_max_ports(&mut self, max_ports: usize)

Set maximum port count per message.

source

pub async fn recv(&mut self) -> Result<Option<DataBuf>, RecvError>

Receives data over the channel.

Waits for data to become available. Received port open requests are silently rejected. The size of the received data is limited by max_data_size.

source

pub async fn recv_chunk(&mut self) -> Result<Option<Bytes>, RecvChunkError>

Receives chunks of data over the channel.

This should be called when recv_any returns Received::Chunks to obtain the received data chunk by chunk. None is returned after the last chunk of a message.

This is unlimited in size.

source

pub async fn recv_any(&mut self) -> Result<Option<Received>, RecvError>

Receives data or ports over the channel.

source

pub async fn close(&mut self)

Closes the sender at the remote endpoint, preventing it from sending new data. Already sent message will still be received.

source

pub fn into_stream(self) -> ReceiverStream

👎Deprecated: use ReceiverStream::from instead

Convert this into a stream.

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 Receiver

source§

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

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

impl Drop for Receiver

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<Receiver> for ReceiverStream

source§

fn from(recv: Receiver) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · 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 Twhere U: From<T>,

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

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

§

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