#[non_exhaustive]pub enum ZoneUpdate<R> {
DeleteAllRecords,
DeleteRecord(R),
AddRecord(R),
BeginBatchDelete(R),
BeginBatchAdd(R),
Finished(R),
}unstable-zonetree only.Expand description
An update to be applied to a Zone.
§Design
The variants of this enum are modelled after the way the AXFR and IXFR protocols represent updates to zones.
AXFR responses can be represented as a sequence of
ZoneUpdate::AddRecords.
IXFR responses can be represented as a sequence of batches, each consisting of:
ZoneUpdate::BeginBatchDeleteZoneUpdate::DeleteRecords (zero or more)ZoneUpdate::BeginBatchAddZoneUpdate::AddRecords (zero or more)
Both AXFR and IXFR responses encoded using this enum are terminated by a
final ZoneUpdate::Finished.
§Use within this crate
XfrResponseInterpreter can convert received XFR responses into
sequences of ZoneUpdates. These can then be consumed by a
ZoneUpdater to effect changes to an existing Zone.
§Future extensions
This enum is marked as #[non_exhaustive] to permit addition of more
update operations in future, e.g. to support RFC 2136 Dynamic Updates
operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DeleteAllRecords
Delete all records in the zone.
DeleteRecord(R)
Delete record R from the zone.
AddRecord(R)
Add record R to the zone.
BeginBatchDelete(R)
Start a batch delete for the version of the zone with the given SOA record.
If not already in batching mode, this signals the start of batching mode. In batching mode one or more batches of updates will be signalled, each consisting of the sequence:
- ZoneUpdate::BeginBatchDelete
- ZoneUpdate::DeleteRecord (zero or more)
- ZoneUpdate::BeginBatchAdd
- ZoneUpdate::AddRecord (zero or more)
Batching mode can only be terminated by UpdateComplete or
UpdateIncomplete.
Batching mode makes updates more predictable for the receiver to work with by limiting the updates that can be signalled next, enabling receiver logic to be simpler and more efficient.
The record must be a SOA record that matches the SOA record of the
zone version in which the subsequent ZoneUpdate::DeleteRecords
should be deleted.
BeginBatchAdd(R)
Start a batch add for the version of the zone with the given SOA record.
This can only be signalled when already in batching mode, i.e. when
BeginBatchDelete has already been signalled.
The record must be the SOA record to use for the new version of the
zone under which the subsequent ZoneUpdate::AddRecords will be
added.
See BeginBatchDelete for more information.
Finished(R)
In progress updates for the zone can now be finalized.
This signals the end of a group of related changes for the given SOA record of the zone.
For example this could be used to trigger an atomic commit of a set of related pending changes.
Trait Implementations§
Source§impl<R: Clone> Clone for ZoneUpdate<R>
impl<R: Clone> Clone for ZoneUpdate<R>
Source§fn clone(&self) -> ZoneUpdate<R>
fn clone(&self) -> ZoneUpdate<R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<R: Debug> Debug for ZoneUpdate<R>
impl<R: Debug> Debug for ZoneUpdate<R>
Source§impl<R> Display for ZoneUpdate<R>
impl<R> Display for ZoneUpdate<R>
impl<R: Eq> Eq for ZoneUpdate<R>
Source§impl<R: PartialEq> PartialEq for ZoneUpdate<R>
impl<R: PartialEq> PartialEq for ZoneUpdate<R>
impl<R: PartialEq> StructuralPartialEq for ZoneUpdate<R>
Auto Trait Implementations§
impl<R> Freeze for ZoneUpdate<R>where
R: Freeze,
impl<R> RefUnwindSafe for ZoneUpdate<R>where
R: RefUnwindSafe,
impl<R> Send for ZoneUpdate<R>where
R: Send,
impl<R> Sync for ZoneUpdate<R>where
R: Sync,
impl<R> Unpin for ZoneUpdate<R>where
R: Unpin,
impl<R> UnsafeUnpin for ZoneUpdate<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for ZoneUpdate<R>where
R: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.