Skip to main content

QueueBuilder

Struct QueueBuilder 

Source
pub struct QueueBuilder<S, V, C = SystemClock> { /* private fields */ }
Expand description

Configures and opens one queue.

Implementations§

Source§

impl<S, V> QueueBuilder<S, V, SystemClock>

Source

pub fn new( store: S, namespace: impl Into<String>, name: impl Into<String>, ) -> Self

Starts a builder for a queue in namespace with name.

The builder takes ownership of store and shares it with the resulting queue through an Arc, so S does not need to implement Clone.

Source§

impl<S, V, C> QueueBuilder<S, V, C>

Source

pub fn schema(self, schema: impl Into<String>) -> Self

Sets the stable application-defined payload schema identifier.

Source

pub fn clock<D: Clock>(self, clock: D) -> QueueBuilder<S, V, D>

Replaces the clock used for lease decisions.

Source§

impl<S, V, C> QueueBuilder<S, V, C>

Source

pub fn create(self) -> Result<Queue<S, V, C>, Error<S::Error>>

Conditionally creates an empty queue.

Source

pub fn open(self) -> Result<Queue<S, V, C>, Error<S::Error>>

Opens and validates an existing queue.

Source

pub fn open_or_create(self) -> Result<Queue<S, V, C>, Error<S::Error>>

Opens a valid queue or atomically creates it when absent.

Auto Trait Implementations§

§

impl<S, V, C> Freeze for QueueBuilder<S, V, C>
where Arc<S>: Freeze, C: Freeze, PhantomData<fn() -> V>: Freeze,

§

impl<S, V, C> RefUnwindSafe for QueueBuilder<S, V, C>

§

impl<S, V, C> Send for QueueBuilder<S, V, C>
where Arc<S>: Send, C: Send, PhantomData<fn() -> V>: Send,

§

impl<S, V, C> Sync for QueueBuilder<S, V, C>
where Arc<S>: Sync, C: Sync, PhantomData<fn() -> V>: Sync,

§

impl<S, V, C> Unpin for QueueBuilder<S, V, C>
where Arc<S>: Unpin, C: Unpin, PhantomData<fn() -> V>: Unpin,

§

impl<S, V, C> UnsafeUnpin for QueueBuilder<S, V, C>

§

impl<S, V, C> UnwindSafe for QueueBuilder<S, V, C>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.