Skip to main content

RefLog

Struct RefLog 

Source
pub struct RefLog { /* private fields */ }
Expand description

The ref log of one repository.

Implementations§

Source§

impl RefLog

Source

pub fn new(path: impl Into<PathBuf>) -> Self

Source

pub fn next_push_seq(&self) -> Result<u64>

The next push_seq this log should use: one past the highest already recorded. Derived from the log itself, so a crashed writer that lost its counter cannot reuse a sequence number and silently reorder history.

Source

pub fn push(&self, updates: &[RefUpdate]) -> Result<u64>

Append one push atomically. Returns the push_seq it was given.

Source

pub fn append_batch(&self, batch: &RecordBatch) -> Result<u64>

Append an already-built push batch, whose push_seq the caller assigned.

For a server that holds its own counter: push re-derives the sequence by rescanning the log, which is the safe default but is O(log) per push. Returns the byte offset the frame starts at.

Source

pub fn scan(&self) -> Result<PushLogScan>

Source

pub fn compact(&self) -> Result<CompactionReport>

Fold every frame into one. See PushLog::compact — rows and their order are preserved, so fold answers identically before and after.

Source

pub fn maybe_compact( &self, policy: CompactionPolicy, ) -> Result<Option<CompactionReport>>

Compact if the log has grown past policy.

Source

pub fn current(&self) -> Result<BTreeMap<String, RefState>>

The current ref namespace.

Source

pub fn seal_section(&self) -> Result<ReservedSection>

The reserved section to seal into the archive.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.