Skip to main content

ZoneUpdate

Enum ZoneUpdate 

Source
#[non_exhaustive]
pub enum ZoneUpdate<R> { DeleteAllRecords, DeleteRecord(R), AddRecord(R), BeginBatchDelete(R), BeginBatchAdd(R), Finished(R), }
Available on crate feature 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:

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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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>

Source§

fn clone(&self) -> ZoneUpdate<R>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug> Debug for ZoneUpdate<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R> Display for ZoneUpdate<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: Eq> Eq for ZoneUpdate<R>

Source§

impl<R: PartialEq> PartialEq for ZoneUpdate<R>

Source§

fn eq(&self, other: &ZoneUpdate<R>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

Source§

type Error = <Target as OctetsFrom<Source>>::Error

Source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
Source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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<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