[−][src]Struct chunky::Queue
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]
ident: &Ident,
typical_chunk_size: usize,
storage: Rc<dyn ChunkStorage>
) -> Self
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,