[][src]Struct yaque::Sender

pub struct Sender { /* fields omitted */ }

The sender part of the queue. This part is lock-free and therefore can be used outside an asynchronous context.

Implementations

impl Sender[src]

pub fn open<P: AsRef<Path>>(base: P) -> Result<Sender>[src]

Opens a queue on a folder indicated by the base path for sending. The folder will be created if it does not already exist.

Errors

This function will return an IO error if the queue is already in use for sending, which is indicated by a lock file. Also, any other IO error encountered while opening will be sent.

pub fn send<D: AsRef<[u8]>>(&mut self, data: D) -> Result<()>[src]

Sends some data into the queue. One send is always atomic.

Errors

This function returns any underlying errors encoutered while writing or flushing the queue.

pub fn send_batch<I>(&mut self, it: I) -> Result<()> where
    I: IntoIterator,
    I::Item: AsRef<[u8]>, 
[src]

Sends all the contents of an iterable into the queue. All is buffered to be sent atomically, in one flush operation.

Trait Implementations

impl Drop for Sender[src]

Auto Trait Implementations

impl RefUnwindSafe for Sender

impl Send for Sender

impl Sync for Sender

impl Unpin for Sender

impl UnwindSafe for Sender

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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.