#[non_exhaustive]pub enum ReservedNetworks {
Included,
Excluded,
}Expand description
Whether reserved (private, documentation, multicast, …) networks are writable.
§Default differs from the Go writer
This crate defaults to ReservedNetworks::Included — inserts into reserved space are
allowed — whereas the Go mmdbwriter excludes them by default. The permissive default is
deliberate: documentation ranges such as 192.0.2.0/24 and 2001:db8::/32 are reserved,
and rejecting them would make the most common example and test networks fail. Choose
ReservedNetworks::Excluded to match the Go behavior.
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.
Included
Allow inserting into reserved networks. Default (differs from the Go writer).
Excluded
Reject inserts that target reserved space (returning Error::ReservedNetwork) and
carve reserved networks out of any broader insert that covers them.
Trait Implementations§
Source§impl Clone for ReservedNetworks
impl Clone for ReservedNetworks
Source§fn clone(&self) -> ReservedNetworks
fn clone(&self) -> ReservedNetworks
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ReservedNetworks
Source§impl Debug for ReservedNetworks
impl Debug for ReservedNetworks
Source§impl Default for ReservedNetworks
impl Default for ReservedNetworks
Source§fn default() -> ReservedNetworks
fn default() -> ReservedNetworks
Returns the “default value” for a type. Read more
impl Eq for ReservedNetworks
Source§impl Hash for ReservedNetworks
impl Hash for ReservedNetworks
Source§impl PartialEq for ReservedNetworks
impl PartialEq for ReservedNetworks
impl StructuralPartialEq for ReservedNetworks
Auto Trait Implementations§
impl Freeze for ReservedNetworks
impl RefUnwindSafe for ReservedNetworks
impl Send for ReservedNetworks
impl Sync for ReservedNetworks
impl Unpin for ReservedNetworks
impl UnsafeUnpin for ReservedNetworks
impl UnwindSafe for ReservedNetworks
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
Mutably borrows from an owned value. Read more