Skip to main content

Tx

Struct Tx 

Source
pub struct Tx<T, const N: usize = 16> { /* private fields */ }
Expand description

Sender handle: “I send”. The holder of a Tx<T> sends items of type T.

In method args, the handler holds it (handler sends → caller).

Wire encoding is always unit (()), with channel IDs carried exclusively in Message::Request.channels.

Implementations§

Source§

impl<T, const N: usize> Tx<T, N>

Source

pub fn unbound() -> Self

Create a standalone unbound Tx (used by deserialization).

Source

pub fn is_bound(&self) -> bool

Source

pub fn has_core(&self) -> bool

Check if this Tx is part of a channel() pair (has a shared core).

Source

pub async fn send<'value>(&self, value: T) -> Result<(), TxError>
where T: Facet<'value>,

Source

pub async fn close<'value>( &self, metadata: Metadata<'value>, ) -> Result<(), TxError>

Trait Implementations§

Source§

impl<T, const N: usize> Drop for Tx<T, N>

Available on non-WebAssembly only.
Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'ʄ, T, const N: usize> Facet<'ʄ> for Tx<T, N>
where T: Facet<'ʄ>,

Source§

const SHAPE: &'static Shape

The shape of this type, including: whether it’s a Struct, an Enum, something else? Read more
Source§

impl<T, const N: usize> TryFrom<&Tx<T, N>> for ()

Source§

type Error = Infallible

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

fn try_from(_value: &Tx<T, N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T, const N: usize> TryFrom<()> for Tx<T, N>

Source§

type Error = Infallible

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

fn try_from(_value: ()) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<T, const N: usize = 16> !Freeze for Tx<T, N>

§

impl<T, const N: usize = 16> !RefUnwindSafe for Tx<T, N>

§

impl<T, const N: usize> Send for Tx<T, N>
where T: Send,

§

impl<T, const N: usize> Sync for Tx<T, N>
where T: Sync,

§

impl<T, const N: usize> Unpin for Tx<T, N>
where T: Unpin,

§

impl<T, const N: usize> UnsafeUnpin for Tx<T, N>

§

impl<T, const N: usize = 16> !UnwindSafe for Tx<T, N>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,