pub enum Section<T> {
Unset,
Set(T),
}Expand description
Sections are merge-able partial values within a configuration tree.
Variants§
Implementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Section<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Section<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>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for Section<T>
Source§impl<T> Merge for Section<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 Section<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> PartialValue for Section<T>where
T: PartialValue + Default,
impl<T> PartialValue for Section<T>where
T: PartialValue + Default,
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
What this becomes once the configuration is complete.
impl<T: PartialEq> StructuralPartialEq for Section<T>
Auto Trait Implementations§
impl<T> Forget for Section<T>
impl<T> Freeze for Section<T>where
T: Freeze,
impl<T> Move for Section<T>
impl<T> RefUnwindSafe for Section<T>where
T: RefUnwindSafe,
impl<T> Send for Section<T>where
T: Send,
impl<T> Sync for Section<T>where
T: Sync,
impl<T> Unpin for Section<T>where
T: Unpin,
impl<T> UnsafeUnpin for Section<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Section<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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.