pub struct SchemaNode {Show 13 fields
pub path: String,
pub name: String,
pub kind: SchemaKind,
pub rust_type: String,
pub required: bool,
pub nullable: bool,
pub default: Option<Value>,
pub aliases: Vec<String>,
pub env: Option<EnvBinding>,
pub merge_hint: Option<MergeHint>,
pub docs: Option<String>,
pub validations: Vec<ValidationRule>,
pub children: BTreeMap<String, Self>,
}Expand description
Schema node describing a configuration path.
Fields§
§path: StringJSON Pointer path for this node.
name: StringLogical field name.
kind: SchemaKindSchema kind.
rust_type: StringRust type name.
required: boolWhether this node is required.
nullable: boolWhether this node accepts null.
default: Option<Value>Default value.
aliases: Vec<String>Alias names for the node.
env: Option<EnvBinding>Environment binding metadata.
merge_hint: Option<MergeHint>Merge hint for the node.
docs: Option<String>Documentation string.
validations: Vec<ValidationRule>Validation rules.
children: BTreeMap<String, Self>Child nodes.
Implementations§
Source§impl SchemaNode
impl SchemaNode
Sourcepub fn new(
path: impl Into<String>,
name: impl Into<String>,
kind: SchemaKind,
rust_type: impl Into<String>,
) -> Self
pub fn new( path: impl Into<String>, name: impl Into<String>, kind: SchemaKind, rust_type: impl Into<String>, ) -> Self
Create a new schema node.
Sourcepub fn default_value(self, default: Value) -> Self
pub fn default_value(self, default: Value) -> Self
Set the default value.
Sourcepub fn env_binding(self, env: EnvBinding) -> Self
pub fn env_binding(self, env: EnvBinding) -> Self
Set environment metadata.
Sourcepub const fn merge_hint(self, merge_hint: MergeHint) -> Self
pub const fn merge_hint(self, merge_hint: MergeHint) -> Self
Set merge hint.
Sourcepub fn validation(self, rule: ValidationRule) -> Self
pub fn validation(self, rule: ValidationRule) -> Self
Add a validation rule.
Trait Implementations§
Source§impl Clone for SchemaNode
impl Clone for SchemaNode
Source§fn clone(&self) -> SchemaNode
fn clone(&self) -> SchemaNode
Returns a duplicate of the value. Read more
1.0.0 · 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 SchemaNode
impl Debug for SchemaNode
Source§impl<'de> Deserialize<'de> for SchemaNode
impl<'de> Deserialize<'de> for SchemaNode
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
Source§impl PartialEq for SchemaNode
impl PartialEq for SchemaNode
Source§impl Serialize for SchemaNode
impl Serialize for SchemaNode
impl StructuralPartialEq for SchemaNode
Auto Trait Implementations§
impl Freeze for SchemaNode
impl RefUnwindSafe for SchemaNode
impl Send for SchemaNode
impl Sync for SchemaNode
impl Unpin for SchemaNode
impl UnsafeUnpin for SchemaNode
impl UnwindSafe for SchemaNode
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