[][src]Struct chunky::Queue

pub struct Queue { /* fields omitted */ }

A FIFO queue which stores heterogeneously sized items

Methods

impl Queue[src]

pub fn new(
    ident: &Ident,
    typical_chunk_size: usize,
    storage: Rc<dyn ChunkStorage>
) -> Self
[src]

Create a new queue

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

Number of items in the queue

pub fn is_empty(&self) -> bool[src]

Is the queue empty?

pub unsafe fn enqueue(&mut self, size: usize) -> *mut u8[src]

Enqueue an item of a given size. Returns a pointer that the item can be written to.

This is handled like this so items of heterogeneous types can be enqueued.

pub unsafe fn dequeue(&mut self) -> Option<*const u8>[src]

Dequeue an item. Returns a pointer to the item in the queue, unless the queue is empty.

pub unsafe fn drop_old_chunks(&mut self)[src]

Delete chunks which have already been read

Auto Trait Implementations

impl !Sync for Queue

impl !Send for Queue

impl Unpin for Queue

impl !RefUnwindSafe for Queue

impl !UnwindSafe for Queue

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

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