pub enum EnumSection<T> {
Unset,
Set(T),
}Expand description
EnumSections are merge-able partial values within a configuration tree that have no default partial value. This is the case for enums, which may not have a default variant.
Variants§
Implementations§
Trait Implementations§
Source§impl<T: Clone> Clone for EnumSection<T>
impl<T: Clone> Clone for EnumSection<T>
Source§impl<T: Debug> Debug for EnumSection<T>
impl<T: Debug> Debug for EnumSection<T>
Source§impl<T> Default for EnumSection<T>
impl<T> Default for EnumSection<T>
Source§impl<'de, T> Deserialize<'de> for EnumSection<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for EnumSection<T>where
T: Deserialize<'de>,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl<T: Eq> Eq for EnumSection<T>
Source§impl<T> Merge for EnumSection<T>where
T: Merge,
A section is a recursive merge boundary: two documents mentioning the same
table is never a conflict by itself, so the policy is only consulted by the
settings underneath.
impl<T> Merge for EnumSection<T>where
T: Merge,
A section is a recursive merge boundary: two documents mentioning the same table is never a conflict by itself, so the policy is only consulted by the settings underneath.
fn merge( &mut self, incoming: Self, context: &mut MergeContext<'_>, ) -> Result<(), ConfigError>
Source§impl<T: PartialEq> PartialEq for EnumSection<T>
impl<T: PartialEq> PartialEq for EnumSection<T>
Source§impl<T> PartialValue for EnumSection<T>where
T: PartialValue,
impl<T> PartialValue for EnumSection<T>where
T: PartialValue,
Source§fn attribute(&mut self, origin: OriginId)
fn attribute(&mut self, origin: OriginId)
A section records no origin of its own, and visits its children.
Source§fn apply_defaults(&mut self)
fn apply_defaults(&mut self)
An absent section still has to be visited: a document that never mentions a section should still get the defaults of everything inside it.
Source§fn resolve(self, path: &mut ConfigPath) -> Result<Self::Resolved, ConfigError>
fn resolve(self, path: &mut ConfigPath) -> Result<Self::Resolved, ConfigError>
A section resolves to whatever its contents resolve to. An unset one only reaches this point when resolving without defaulting first, and resolving the empty struct still reports any required value it misses.
Source§type Resolved = <T as PartialValue>::Resolved
type Resolved = <T as PartialValue>::Resolved
Source§impl<T> Serialize for EnumSection<T>where
T: Serialize,
impl<T> Serialize for EnumSection<T>where
T: Serialize,
impl<T: PartialEq> StructuralPartialEq for EnumSection<T>
Auto Trait Implementations§
impl<T> Forget for EnumSection<T>
impl<T> Freeze for EnumSection<T>where
T: Freeze,
impl<T> Move for EnumSection<T>
impl<T> RefUnwindSafe for EnumSection<T>where
T: RefUnwindSafe,
impl<T> Send for EnumSection<T>where
T: Send,
impl<T> Sync for EnumSection<T>where
T: Sync,
impl<T> Unpin for EnumSection<T>where
T: Unpin,
impl<T> UnsafeUnpin for EnumSection<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for EnumSection<T>where
T: 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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.