Struct yaque::SenderBuilder[][src]

pub struct SenderBuilder { /* fields omitted */ }

A builder for the sender side of the queue. Use this if you want to have fine-grained control over the configuration of the queue. Most defaults sould be ok of most applications.

Implementations

impl SenderBuilder[src]

pub fn new() -> SenderBuilder[src]

Creates a new sender builder. Finish build it by invoking SenderBuilder::open.

pub fn segment_size(self, size: u64) -> SenderBuilder[src]

The segment size in bytes that will trigger a new segment to be created. Segments an be bigger than this to accomodate the last element, but nothing beyond that (each segment must store at least one element).

Default value: 4 * 1024 * 1024, or 4MB.

Panics

This function panics if size is zero.

pub fn max_queue_size(self, size: Option<u64>) -> SenderBuilder[src]

The queue size that will block the sender from creating a new segment (until the receiver catches up, deleting old segments). The queue can get bigger than that, but only to accomodate the last segment (the queue must have at least one segment). Set this to None to create an unbounded queue.

This value will be ignored if the queue has only one segment, since the queue would deadlock otherwise. It is recomended that you set max_queue_size >> segment_size.

Default value: None

Panics

This function panics if size is zero.

pub fn open<P: AsRef<Path>>(self, 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.

Trait Implementations

impl Default for SenderBuilder[src]

Auto Trait Implementations

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> Pointable for T

type Init = T

The type for initializers.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,