Journal

Struct Journal 

Source
pub struct Journal { /* private fields */ }
Available on crate feature sqlite only.
Expand description

The Journal is the audit log of all changes to a zone after initial creation.

Implementations§

Source§

impl Journal

Source

pub fn new(conn: Connection) -> PersistenceResult<Self>

Constructs a new Journal, attaching to the specified Sqlite Connection

Source

pub fn from_file(journal_file: &Path) -> PersistenceResult<Self>

Constructs a new Journal opening a Sqlite connection to the file at the specified path

Source

pub fn conn(&self) -> MutexGuard<'_, Connection>

Returns a reference to the Sqlite Connection

Source

pub fn schema_version(&self) -> i64

Returns the current schema version of the journal

Source

pub fn iter(&self) -> JournalIter<'_>

this returns an iterator from the beginning of time, to be used to recreate an authority

Source

pub fn insert_record( &self, soa_serial: u32, record: &Record, ) -> PersistenceResult<()>

Inserts a record, this is an append only operation.

Records should never be posthumously modified. The message will be serialized into the. the first message serialized to the journal, should be a single AXFR of the entire zone, this will be used as a starting point to reconstruct the zone.

§Argument
  • record - will be serialized into the journal
Source

pub fn insert_records( &self, soa_serial: u32, records: &[Record], ) -> PersistenceResult<()>

Inserts a set of records into the Journal, a convenience method for insert_record

Source

pub fn select_record( &self, row_id: i64, ) -> PersistenceResult<Option<(i64, Record)>>

Selects a record from the given row_id.

This allows for the entire set of records to be iterated through, by starting at 0, and incrementing each subsequent row.

§Arguments
  • row_id - the row_id can either be exact, or start at 0 to get the earliest row in the list.
Source

pub fn select_schema_version(conn: &Connection) -> PersistenceResult<i64>

selects the current schema version of the journal DB, returns -1 if there is no schema

§Arguments
  • conn - db connection to use
Source

pub fn schema_up(&mut self) -> PersistenceResult<i64>

initializes the schema for the Journal

Auto Trait Implementations§

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more