OffsetLog

Struct OffsetLog 

Source
pub struct OffsetLog<ByteType> {
    pub file: File,
    /* private fields */
}

Fields§

§file: File

Implementations§

Source§

impl<ByteType> OffsetLog<ByteType>

Source

pub fn new<P: AsRef<Path>>(path: P) -> Result<OffsetLog<ByteType>, Error>

Source

pub fn open_read_only<P: AsRef<Path>>( path: P, ) -> Result<OffsetLog<ByteType>, Error>

Source

pub fn from_file(file: File) -> Result<OffsetLog<ByteType>, Error>

Source

pub fn end(&self) -> u64

Source

pub fn read(&self, offset: u64) -> Result<ReadResult, Error>

Source

pub fn append_batch<T: AsRef<[u8]>>( &mut self, buffs: &[T], ) -> Result<Vec<u64>, Error>

Source

pub fn iter(&self) -> Forward<OffsetLogIter<ByteType>>

Source

pub fn bidir_iter(&self) -> OffsetLogIter<ByteType>

Source

pub fn bidir_iter_at_offset(&self, offset: u64) -> OffsetLogIter<ByteType>

Trait Implementations§

Source§

impl<ByteType> FlumeLog for OffsetLog<ByteType>

Source§

fn get(&self, seq_num: u64) -> Result<Vec<u8>, Error>

Source§

fn latest(&self) -> Option<u64>

Source§

fn append(&mut self, buff: &[u8]) -> Result<u64, Error>

Source§

fn clear(&mut self, _seq_num: u64)

Source§

impl<ByteType> IterAtOffset<Forward<OffsetLogIter<ByteType>>> for OffsetLog<ByteType>

Source§

fn iter_at_offset(&self, offset: u64) -> Forward<OffsetLogIter<ByteType>>

Auto Trait Implementations§

§

impl<ByteType> Freeze for OffsetLog<ByteType>

§

impl<ByteType> RefUnwindSafe for OffsetLog<ByteType>
where ByteType: RefUnwindSafe,

§

impl<ByteType> Send for OffsetLog<ByteType>
where ByteType: Send,

§

impl<ByteType> Sync for OffsetLog<ByteType>
where ByteType: Sync,

§

impl<ByteType> Unpin for OffsetLog<ByteType>
where ByteType: Unpin,

§

impl<ByteType> UnwindSafe for OffsetLog<ByteType>
where ByteType: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

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

Source§

fn vzip(self) -> V