[][src]Struct wired::Queue

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

a First-In-First-Out data structure

A Queue is backed by a memory-mapped file, so the full content does not reside in RAM when not needed. It is type-safe over a generic type that can be serialized through serde.

What exactly is a Queue?

In computer science, a queue is a collection of entities that are maintained in a sequence and can be modified by the addition of entities at one end of the sequence and removal from the other end of the sequence. By convention, the end of the sequence at which elements are added is called the back, tail, or rear of the queue and the end at which elements are removed is called the head or front of the queue, analogously to the words used when people line up to wait for goods or services.

  • The operation of adding an element to the rear of the queue is known as enqueue,
  • and the operation of removing an element from the front is known as dequeue.

-- Wikipedia

Methods

impl<T> Queue<T> where
    T: Serialize,
    T: Deserialize<'de>, 
[src]

pub fn new(path: &str) -> Result<Self, Box<dyn Error>>[src]

pub fn len(&self) -> usize[src]

pub fn wasted_file_space(&self) -> f64[src]

pub fn enqueue(&mut self, data: &T) -> Result<(), Box<dyn Error>>[src]

pub fn dequeue(&mut self) -> Result<Option<T>, Box<dyn Error>>[src]

pub fn compact(&mut self) -> Result<(), Box<dyn Error>>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Queue<T>

impl<T> !Send for Queue<T>

impl<T> !Sync for Queue<T>

impl<T> Unpin for Queue<T> where
    T: Unpin

impl<T> !UnwindSafe for Queue<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.

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