pub struct QueueFile { /* private fields */ }Implementations§
Source§impl QueueFile
impl QueueFile
Sourcepub fn with_capacity<P: AsRef<Path>>(
path: P,
capacity: u64,
) -> Result<Self, Error>
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.
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
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.
Sourcepub fn open_legacy<P: AsRef<Path>>(path: P) -> Result<Self, Error>
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.
pub const fn overwrite_on_remove(&self) -> bool
pub const fn get_overwrite_on_remove(&self) -> bool
👎Deprecated since 1.4.7:
Use overwrite_on_remove instead.
pub fn set_overwrite_on_remove(&mut self, value: bool)
pub const fn sync_writes(&self) -> bool
pub const fn get_sync_writes(&self) -> bool
👎Deprecated since 1.4.7:
Use sync_writes instead.
pub fn set_sync_writes(&mut self, value: bool)
pub const fn skip_write_header_on_add(&self) -> bool
pub const fn get_skip_write_header_on_add(&self) -> bool
👎Deprecated since 1.4.7:
Use skip_write_header_on_add instead.
pub fn set_skip_write_header_on_add(&mut self, value: bool)
pub const fn cache_offset_policy(&self) -> Option<OffsetCacheKind>
pub const fn get_cache_offset_policy(&self) -> Option<OffsetCacheKind>
👎Deprecated since 1.4.7:
Use cache_offset_policy instead.
pub fn set_cache_offset_policy( &mut self, kind: impl Into<Option<OffsetCacheKind>>, )
pub const fn is_empty(&self) -> bool
pub const fn size(&self) -> usize
pub fn sync_all(&mut self) -> Result<(), Error>
pub fn add_n( &mut self, elems: impl IntoIterator<Item = impl AsRef<[u8]>>, ) -> Result<(), Error>
pub fn add(&mut self, buf: &[u8]) -> Result<(), Error>
pub fn peek(&self) -> Result<Option<Vec<u8>>, Error>
pub fn peek_into(&self, buf: &mut Vec<u8>) -> Result<bool, Error>
pub fn remove(&mut self) -> Result<(), Error>
pub fn remove_n(&mut self, n: usize) -> Result<(), Error>
pub fn clear(&mut self) -> Result<(), Error>
pub const fn iter(&self) -> Iter<'_> ⓘ
pub const fn file_len(&self) -> u64
pub const fn used_bytes(&self) -> u64
pub fn into_inner_file(self) -> Result<File, Error>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QueueFile
impl !RefUnwindSafe for QueueFile
impl !Sync for QueueFile
impl Send for QueueFile
impl Unpin for QueueFile
impl UnsafeUnpin for QueueFile
impl UnwindSafe for QueueFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more