pub struct HistoryWriter { /* private fields */ }Expand description
Writes history in groups of changes_group ledgers.
Implementations§
Source§impl HistoryWriter
impl HistoryWriter
Sourcepub fn create(
dir: &Path,
first: u32,
changes_group: u32,
tx_level: i32,
changes_level: i32,
dict: Option<&Dict>,
delta: bool,
) -> Result<HistoryWriter, String>
pub fn create( dir: &Path, first: u32, changes_group: u32, tx_level: i32, changes_level: i32, dict: Option<&Dict>, delta: bool, ) -> Result<HistoryWriter, String>
A new segment starting at ledger first. A segment with the same start that
has no complete record in the changes index is left over from a crash during
the first group: a ledger is in the history only when both streams are written,
so none was ever read from it and it can be replaced.
If a complete group is there, the history already extends past first; such
a call should not happen, and the files are left alone.
Sourcepub fn append(
&mut self,
sequence: u32,
body: Vec<u8>,
prev: Option<&PrevAt>,
) -> Result<(), String>
pub fn append( &mut self, sequence: u32, body: Vec<u8>, prev: Option<&PrevAt>, ) -> Result<(), String>
A ledger in Ledger::encode serialization. Format 3 changes need
the previous version of objects: prev as of the ledger before this one.
pub fn buffered(&self) -> usize
Sourcepub fn flush(&mut self) -> Result<(), String>
pub fn flush(&mut self) -> Result<(), String>
Writes what has accumulated: transaction frames, then the changes block.
pub fn finish(self) -> Result<(), String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HistoryWriter
impl RefUnwindSafe for HistoryWriter
impl Send for HistoryWriter
impl Sync for HistoryWriter
impl Unpin for HistoryWriter
impl UnsafeUnpin for HistoryWriter
impl UnwindSafe for HistoryWriter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].