pub struct Journal { /* private fields */ }sqlite only.Expand description
The Journal is the audit log of all changes to a zone after initial creation.
Implementations§
Source§impl Journal
impl Journal
Sourcepub fn new(conn: Connection) -> Result<Self, PersistenceError>
pub fn new(conn: Connection) -> Result<Self, PersistenceError>
Constructs a new Journal, attaching to the specified Sqlite Connection
Sourcepub fn from_file(journal_file: &Path) -> Result<Self, PersistenceError>
pub fn from_file(journal_file: &Path) -> Result<Self, PersistenceError>
Constructs a new Journal opening a Sqlite connection to the file at the specified path
Sourcepub fn conn(&self) -> MutexGuard<'_, Connection>
pub fn conn(&self) -> MutexGuard<'_, Connection>
Returns a reference to the Sqlite Connection
Sourcepub fn schema_version(&self) -> i64
pub fn schema_version(&self) -> i64
Returns the current schema version of the journal
Sourcepub fn iter(&self) -> JournalIter<'_> ⓘ
pub fn iter(&self) -> JournalIter<'_> ⓘ
this returns an iterator from the beginning of time, to be used to recreate a zone handler
Sourcepub fn insert_record(
&self,
soa_serial: u32,
record: &Record,
) -> Result<(), PersistenceError>
pub fn insert_record( &self, soa_serial: u32, record: &Record, ) -> Result<(), PersistenceError>
Inserts a record, this is an append only operation.
Records should never be posthumously modified. The first message serialized to the journal should be a single AXFR of the entire zone to be used as a starting point for reconstruction.
§Argument
record- will be serialized into the journal
Sourcepub fn insert_records(
&self,
soa_serial: u32,
records: &[Record],
) -> Result<(), PersistenceError>
pub fn insert_records( &self, soa_serial: u32, records: &[Record], ) -> Result<(), PersistenceError>
Inserts a set of records into the Journal, a convenience method for insert_record
Sourcepub fn select_record(
&self,
row_id: i64,
) -> Result<Option<(i64, Record)>, PersistenceError>
pub fn select_record( &self, row_id: i64, ) -> Result<Option<(i64, Record)>, PersistenceError>
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.
Sourcepub fn select_schema_version(conn: &Connection) -> Result<i64, PersistenceError>
pub fn select_schema_version(conn: &Connection) -> Result<i64, PersistenceError>
selects the current schema version of the journal DB, returns -1 if there is no schema
§Arguments
conn- db connection to use
Sourcepub fn schema_up(&mut self) -> Result<i64, PersistenceError>
pub fn schema_up(&mut self) -> Result<i64, PersistenceError>
initializes the schema for the Journal
Auto Trait Implementations§
impl !Freeze for Journal
impl RefUnwindSafe for Journal
impl Send for Journal
impl Sync for Journal
impl Unpin for Journal
impl UnsafeUnpin for Journal
impl UnwindSafe for Journal
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more