pub trait ConfigValue: Clone {
type Object: ConfigObject<Self>;
// Required methods
fn kind(&self) -> &'static str;
fn as_object(&self) -> Option<&Self::Object>;
fn as_object_mut(&mut self) -> Option<&mut Self::Object>;
fn into_object(self) -> Result<Self::Object, Self>;
fn as_array(&self) -> Option<&[Self]>;
fn as_str(&self) -> Option<&str>;
fn object(object: Self::Object) -> Self;
fn array(items: Vec<Self>) -> Self;
fn string(text: String) -> Self;
fn stringify(&self) -> Option<String>;
}Expand description
Structural operations on a native configuration value.
Scalars stay opaque to merge and traversal. Implementations classify
integers and floats as number, and render scalars without quoting strings.
Required Associated Types§
Sourcetype Object: ConfigObject<Self>
type Object: ConfigObject<Self>
The native object type.
Required Methods§
Sourcefn kind(&self) -> &'static str
fn kind(&self) -> &'static str
A diagnostic kind: object, array, string, number, bool, null or datetime.
Sourcefn as_object_mut(&mut self) -> Option<&mut Self::Object>
fn as_object_mut(&mut self) -> Option<&mut Self::Object>
Mutably borrow an object, if this is one.
Sourcefn into_object(self) -> Result<Self::Object, Self>
fn into_object(self) -> Result<Self::Object, Self>
Consume an object; return the original value for any other kind.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".