Skip to main content

QueueFile

Struct QueueFile 

Source
pub struct QueueFile { /* private fields */ }

Implementations§

Source§

impl QueueFile

Source

pub fn with_capacity<P: AsRef<Path>>( path: P, capacity: u64, ) -> Result<Self, Error>

Opens or creates a QueueFile at path with the given initial file size.

Source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Opens or creates a QueueFile at path using v2 format with a 4 KiB initial file size.

Source

pub fn open_legacy<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Opens or creates a QueueFile at path using the legacy (16-byte) header format.

Source

pub const fn overwrite_on_remove(&self) -> bool

Source

pub const fn get_overwrite_on_remove(&self) -> bool

👎Deprecated since 1.4.7:

Use overwrite_on_remove instead.

Source

pub fn set_overwrite_on_remove(&mut self, value: bool)

Source

pub const fn sync_writes(&self) -> bool

Source

pub const fn get_sync_writes(&self) -> bool

👎Deprecated since 1.4.7:

Use sync_writes instead.

Source

pub fn set_sync_writes(&mut self, value: bool)

Source

pub const fn skip_write_header_on_add(&self) -> bool

Source

pub const fn get_skip_write_header_on_add(&self) -> bool

👎Deprecated since 1.4.7:

Use skip_write_header_on_add instead.

Source

pub fn set_skip_write_header_on_add(&mut self, value: bool)

Source

pub const fn cache_offset_policy(&self) -> Option<OffsetCacheKind>

Source

pub const fn get_cache_offset_policy(&self) -> Option<OffsetCacheKind>

👎Deprecated since 1.4.7:

Use cache_offset_policy instead.

Source

pub fn set_cache_offset_policy( &mut self, kind: impl Into<Option<OffsetCacheKind>>, )

Source

pub const fn is_empty(&self) -> bool

Source

pub const fn size(&self) -> usize

Source

pub fn sync_all(&mut self) -> Result<(), Error>

Source

pub fn add_n( &mut self, elems: impl IntoIterator<Item = impl AsRef<[u8]>>, ) -> Result<(), Error>

Source

pub fn add(&mut self, buf: &[u8]) -> Result<(), Error>

Source

pub fn peek(&self) -> Result<Option<Vec<u8>>, Error>

Source

pub fn peek_into(&self, buf: &mut Vec<u8>) -> Result<bool, Error>

Source

pub fn remove(&mut self) -> Result<(), Error>

Source

pub fn remove_n(&mut self, n: usize) -> Result<(), Error>

Source

pub fn clear(&mut self) -> Result<(), Error>

Source

pub const fn iter(&self) -> Iter<'_> ⓘ

Source

pub const fn file_len(&self) -> u64

Source

pub const fn used_bytes(&self) -> u64

Source

pub fn into_inner_file(self) -> Result<File, Error>

Trait Implementations§

Source§

impl Debug for QueueFile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for QueueFile

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a> IntoIterator for &'a QueueFile

Source§

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?
Source§

type Item = Vec<u8>

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

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.