Struct remoc::rch::watch::Receiver

source ·
pub struct Receiver<T, Codec = Default, const MAX_ITEM_SIZE: usize = DEFAULT_MAX_ITEM_SIZE> { /* private fields */ }
Available on crate feature rch only.
Expand description

Receive values from the associated Sender, which may be located on a remote endpoint.

Instances are created by the channel function.

This can be converted into a Stream of values by wrapping it into a ReceiverStream.

Implementations§

source§

impl<T, Codec, const MAX_ITEM_SIZE: usize> Receiver<T, Codec, MAX_ITEM_SIZE>

source

pub fn borrow(&self) -> Result<Ref<'_, T>, RecvError>

Returns a reference to the most recently received value.

source

pub fn borrow_and_update(&mut self) -> Result<Ref<'_, T>, RecvError>

Returns a reference to the most recently received value and mark that value as seen.

source

pub async fn changed(&mut self) -> Result<(), ChangedError>

Wait for a change notification, then mark the newest value as seen.

source

pub fn max_item_size(&self) -> usize

Maximum allowed item size in bytes when receiving items.

source

pub fn set_max_item_size<const NEW_MAX_ITEM_SIZE: usize>( self ) -> Receiver<T, Codec, NEW_MAX_ITEM_SIZE>

Sets the maximum allowed item size in bytes when receiving items.

source

pub fn remote_max_item_size(&self) -> Option<usize>

The maximum item size of the remote sender.

If this is larger than max_item_size sending of oversized items will succeed but receiving will fail with a MaxItemSizeExceeded error.

Trait Implementations§

source§

impl<T: Clone, Codec: Clone, const MAX_ITEM_SIZE: usize> Clone for Receiver<T, Codec, MAX_ITEM_SIZE>

source§

fn clone(&self) -> Receiver<T, Codec, MAX_ITEM_SIZE>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, Codec, const MAX_ITEM_SIZE: usize> Debug for Receiver<T, Codec, MAX_ITEM_SIZE>

source§

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

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

impl<'de, T, Codec, const MAX_ITEM_SIZE: usize> Deserialize<'de> for Receiver<T, Codec, MAX_ITEM_SIZE>
where T: RemoteSend + Sync, Codec: Codec,

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserializes the receiver after it has been received over a chmux channel.

source§

impl<T, Codec, const MAX_ITEM_SIZE: usize> Drop for Receiver<T, Codec, MAX_ITEM_SIZE>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T, Codec, const MAX_ITEM_SIZE: usize> From<Receiver<T, Codec, MAX_ITEM_SIZE>> for ReceiverStream<T, Codec, MAX_ITEM_SIZE>
where T: RemoteSend + Sync, Codec: Send + 'static,

source§

fn from(recv: Receiver<T, Codec, MAX_ITEM_SIZE>) -> Self

Converts to this type from the input type.
source§

impl<T, Codec, const MAX_ITEM_SIZE: usize> Serialize for Receiver<T, Codec, MAX_ITEM_SIZE>
where T: RemoteSend + Sync + Clone, Codec: Codec,

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serializes this receiver for sending over a chmux channel.

Auto Trait Implementations§

§

impl<T, Codec, const MAX_ITEM_SIZE: usize> Freeze for Receiver<T, Codec, MAX_ITEM_SIZE>

§

impl<T, Codec = Json, const MAX_ITEM_SIZE: usize = DEFAULT_MAX_ITEM_SIZE> !RefUnwindSafe for Receiver<T, Codec, MAX_ITEM_SIZE>

§

impl<T, Codec, const MAX_ITEM_SIZE: usize> Send for Receiver<T, Codec, MAX_ITEM_SIZE>
where Codec: Send, T: Send + Sync,

§

impl<T, Codec, const MAX_ITEM_SIZE: usize> Sync for Receiver<T, Codec, MAX_ITEM_SIZE>
where Codec: Sync, T: Send + Sync,

§

impl<T, Codec, const MAX_ITEM_SIZE: usize> Unpin for Receiver<T, Codec, MAX_ITEM_SIZE>
where Codec: Unpin,

§

impl<T, Codec = Json, const MAX_ITEM_SIZE: usize = DEFAULT_MAX_ITEM_SIZE> !UnwindSafe for Receiver<T, Codec, MAX_ITEM_SIZE>

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> RemoteSend for T
where T: Send + Serialize + DeserializeOwned + 'static,