[][src]Struct segments::DiskLog

pub struct DiskLog { /* fields omitted */ }

Implementations

impl DiskLog[src]

pub fn new<P: Into<PathBuf>>(
    dir: P,
    max_index_size: u64,
    max_segment_size: u64,
    max_segments: usize
) -> Result<DiskLog>
[src]

pub fn append(&mut self, record: &[u8]) -> Result<()>[src]

pub fn read(&mut self, base_offset: u64, offset: u64) -> Result<Vec<u8>>[src]

Read a record from correct segment Returns data, next base offset and relative offset

pub fn readv(
    &mut self,
    base_offset: u64,
    relative_offset: u64,
    size: u64
) -> Result<(u64, u64, u64, Vec<u8>)>
[src]

Reads multiple packets from the disk and return base offset and relative offset of the Returns base offset, relative offset of the last record along with number of messages and count Goes to next segment when relative off set crosses boundary

pub fn close(&mut self, base_offset: u64) -> Result<()>[src]

pub fn remove(&mut self, base_offset: u64) -> Result<()>[src]

pub fn close_all(&mut self) -> Result<()>[src]

pub fn remove_all(&mut self) -> Result<()>[src]

Auto Trait Implementations

impl RefUnwindSafe for DiskLog

impl Send for DiskLog

impl Sync for DiskLog

impl Unpin for DiskLog

impl UnwindSafe for DiskLog

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<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.