[][src]Struct syscall::io_uring::v1::SpscSender

pub struct SpscSender<T> { /* fields omitted */ }

A safe wrapper over the raw Ring interface, that takes care of the mmap offset, as well as the global Ring structure. Only allows sending items.

The SpscSender is Send, and can thus be transferred between threads. However, it is !Sync, since it does not take multiple atomic senders into account. Thus, it will have to be wrapped in something like a Mutex, if that is necessary.

Implementations

impl<T> SpscSender<T>[src]

pub unsafe fn from_raw(ring: *const Ring<T>, entries_base: *mut T) -> Self[src]

pub fn try_send(&self, item: T) -> Result<(), RingPushError<T>>[src]

pub fn spin_on_send(&self, item: T) -> Result<(), RingSendError<T>>[src]

pub fn deallocate(self) -> Result<()>[src]

pub unsafe fn ring_header(&self) -> &Ring<T>[src]

Retrieve the ring header, which stores head and tail pointers, and epochs.

Safety

This is unsafe because it allows arbitrarily changing the head and tail pointers (indices). While the only allowed entries thus far have a valid repr, and thus allow any bytes to be reinterpreted, this can produce invalid commands that may corrupt the memory of the current process.

pub fn notify(&self)[src]

Wake the receiver up if it was blocking on a new message, without sending anything. This is useful when building a core::future::Future executor, for the core::task::Waker.

Trait Implementations

impl<T> Drop for SpscSender<T>[src]

impl<T: Send> Send for SpscSender<T>[src]

Auto Trait Implementations

impl<T> !Sync for SpscSender<T>

impl<T> Unpin for SpscSender<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.