[−][src]Struct segments::DiskLog
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]
dir: P,
max_index_size: u64,
max_segment_size: u64,
max_segments: usize
) -> Result<DiskLog>
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]
&mut self,
base_offset: u64,
relative_offset: u64,
size: u64
) -> Result<(u64, u64, u64, Vec<u8>)>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,