Struct trust_dns_server::store::sqlite::persistence::Journal
source · [−]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
sourceimpl Journal
impl Journal
sourcepub fn new(conn: Connection) -> PersistenceResult<Journal>
pub fn new(conn: Connection) -> PersistenceResult<Journal>
Constructs a new Journal, attaching to the specified Sqlite Connection
sourcepub fn from_file(journal_file: &Path) -> PersistenceResult<Journal>
pub fn from_file(journal_file: &Path) -> PersistenceResult<Journal>
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<'_>ⓘNotable traits for JournalIter<'j>impl<'j> Iterator for JournalIter<'j> type Item = Record;
pub fn iter(&self) -> JournalIter<'_>ⓘNotable traits for JournalIter<'j>impl<'j> Iterator for JournalIter<'j> type Item = Record;
this returns an iterator from the beginning of time, to be used to recreate an authority
sourcepub fn insert_record(
&self,
soa_serial: u32,
record: &Record
) -> PersistenceResult<()>
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
sourcepub fn insert_records(
&self,
soa_serial: u32,
records: &[Record]
) -> PersistenceResult<()>
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
sourcepub fn select_record(
&self,
row_id: i64
) -> PersistenceResult<Option<(i64, Record)>>
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.
sourcepub fn select_schema_version(conn: &Connection) -> PersistenceResult<i64>
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
sourcepub fn schema_up(&mut self) -> PersistenceResult<i64>
pub fn schema_up(&mut self) -> PersistenceResult<i64>
initializes the schema for the Journal
Auto Trait Implementations
impl RefUnwindSafe for Journal
impl Send for Journal
impl Sync for Journal
impl Unpin for Journal
impl UnwindSafe for Journal
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more