pub struct ReceiverBuilder { /* private fields */ }
Expand description

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

Implementations§

source§

impl ReceiverBuilder

source

pub fn new() -> ReceiverBuilder

source

pub fn save_every_nth(self, nth: Option<usize>) -> ReceiverBuilder

Sets the receiver to save its state to the disk at every n-th element. Set it to None to disable this policy.

Default value: every 250 elements.

source

pub fn save_every(self, duration: Option<Duration>) -> ReceiverBuilder

Sets the receiver to save ir state to the disk at every given interval of time. Set it to None to disable this policy.

Default value: every 350 milliseconds.

Note:

This policy is enforced synchronously. This means that there is no asynchronous behavior involved (i.e. timers). This condition will only be checked when a new element is pushed to the queue.

source

pub fn open<P: AsRef<Path>>(self, base: P) -> Result<Receiver>

Opens a queue for reading. The access will be exclusive, based on the existence of the temporary file recv.lock inside the queue folder.

Errors

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

Panics

This function will panic if it is not able to set up the notification handler to watch for file changes.

Trait Implementations§

source§

impl Default for ReceiverBuilder

source§

fn default() -> ReceiverBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.
§

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

§

fn vzip(self) -> V