pub enum SpecConfigType {
Base(Base),
List(Box<SpecConfigType>),
Set(Box<SpecConfigType>),
Map(Base, Box<SpecConfigType>),
Option(Box<SpecConfigType>),
Union(Vec<SpecConfigType>),
}Expand description
A config property’s type, as written.
Variants§
Base(Base)
List(Box<SpecConfigType>)
list<T> — ordered, duplicates kept.
Set(Box<SpecConfigType>)
set<T> — deduplicated.
Map(Base, Box<SpecConfigType>)
map<K, V> — the key is always a base type.
Option(Box<SpecConfigType>)
option<T> — may be absent, with no default standing in.
Union(Vec<SpecConfigType>)
a|b — one of several. Only what a spec can express; nothing validates which.
Implementations§
Source§impl SpecConfigType
impl SpecConfigType
Sourcepub fn simplified(&self) -> &SpecConfigType
pub fn simplified(&self) -> &SpecConfigType
The type this collapses to for a consumer that only handles one shape.
A union’s first member, an option’s inner type: what a schema generator writes when it has to pick. Kept here rather than in each generator so they agree.
Sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Whether a value may be absent with nothing standing in for it.
Trait Implementations§
Source§impl Clone for SpecConfigType
impl Clone for SpecConfigType
Source§fn clone(&self) -> SpecConfigType
fn clone(&self) -> SpecConfigType
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 moreSource§impl Debug for SpecConfigType
impl Debug for SpecConfigType
Source§impl Default for SpecConfigType
impl Default for SpecConfigType
Source§impl Display for SpecConfigType
impl Display for SpecConfigType
impl Eq for SpecConfigType
Source§impl FromStr for SpecConfigType
impl FromStr for SpecConfigType
Source§impl PartialEq for SpecConfigType
impl PartialEq for SpecConfigType
Source§impl Serialize for SpecConfigType
impl Serialize for SpecConfigType
impl StructuralPartialEq for SpecConfigType
Auto Trait Implementations§
impl Freeze for SpecConfigType
impl RefUnwindSafe for SpecConfigType
impl Send for SpecConfigType
impl Sync for SpecConfigType
impl Unpin for SpecConfigType
impl UnsafeUnpin for SpecConfigType
impl UnwindSafe for SpecConfigType
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,
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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more