Struct thingbuf::mpsc::blocking::SendRef

source ·
pub struct SendRef<'a, T>(/* private fields */);
Available on crate feature std only.
Expand description

A reference to a message being sent to a blocking channel.

A SendRef represents the exclusive permission to mutate a given element in a channel. A SendRef<T> implements DerefMut<T> to allow writing to that element. This is analogous to the Ref type, except that it completes a send_ref or try_send_ref operation when it is dropped.

This type is returned by the Sender::send_ref and Sender::try_send_ref (or StaticSender::send_ref and StaticSender::try_send_ref) methods.

Trait Implementations§

source§

impl<T: Debug> Debug for SendRef<'_, T>

source§

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

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

impl<T> Deref for SendRef<'_, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T> DerefMut for SendRef<'_, T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<T: Display> Display for SendRef<'_, T>

source§

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

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

impl<T: Write> Write for SendRef<'_, T>

source§

fn write_str(&mut self, s: &str) -> Result

Writes a string slice into this writer, returning whether the write succeeded. Read more
source§

fn write_char(&mut self, c: char) -> Result

Writes a char into this writer, returning whether the write succeeded. Read more
source§

fn write_fmt(&mut self, f: Arguments<'_>) -> Result

Glue for usage of the write! macro with implementors of this trait. Read more

Auto Trait Implementations§

§

impl<'a, T> Freeze for SendRef<'a, T>

§

impl<'a, T> !RefUnwindSafe for SendRef<'a, T>

§

impl<'a, T> Send for SendRef<'a, T>
where T: Send,

§

impl<'a, T> Sync for SendRef<'a, T>
where T: Send,

§

impl<'a, T> Unpin for SendRef<'a, T>

§

impl<'a, T> !UnwindSafe for SendRef<'a, T>

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, 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.