pub struct TypeDescription { /* private fields */ }Expand description
Human-readable description for a Rust type used in configuration parameter (Boolean value, integer, string etc.).
If a configuration parameter supports complex inputs (objects and/or arrays), this information may contain info on child types (array items; map keys / values).
Implementations§
Source§impl TypeDescription
impl TypeDescription
Sourcepub fn unit(&self) -> Option<UnitOfMeasurement>
pub fn unit(&self) -> Option<UnitOfMeasurement>
Gets the unit of measurement.
Sourcepub fn items(&self) -> Option<(BasicTypes, &Self)>
pub fn items(&self) -> Option<(BasicTypes, &Self)>
Returns the description of array items, if one was provided.
Sourcepub fn keys(&self) -> Option<(BasicTypes, &Self)>
pub fn keys(&self) -> Option<(BasicTypes, &Self)>
Returns the description of map keys, if one was provided.
Sourcepub fn values(&self) -> Option<(BasicTypes, &Self)>
pub fn values(&self) -> Option<(BasicTypes, &Self)>
Returns the description of map values, if one was provided.
Sourcepub fn fallback(&self) -> Option<(BasicTypes, &Self)>
pub fn fallback(&self) -> Option<(BasicTypes, &Self)>
Returns the fallback description, if any.
Sourcepub fn contains_secrets(&self) -> bool
pub fn contains_secrets(&self) -> bool
Checks whether this type or any child types (e.g., array items or map keys / values) are marked as secret.
Sourcepub fn set_details(
&mut self,
details: impl Into<Cow<'static, str>>,
) -> &mut Self
pub fn set_details( &mut self, details: impl Into<Cow<'static, str>>, ) -> &mut Self
Sets human-readable type details.
Sourcepub fn set_unit(&mut self, unit: UnitOfMeasurement) -> &mut Self
pub fn set_unit(&mut self, unit: UnitOfMeasurement) -> &mut Self
Adds a unit of measurement.
Sourcepub fn set_validations<T>(
&mut self,
validations: &[&'static dyn Validate<T>],
) -> &mut Self
pub fn set_validations<T>( &mut self, validations: &[&'static dyn Validate<T>], ) -> &mut Self
Sets validation for the type.
Sourcepub fn set_deserialize_if<T>(
&mut self,
condition: &'static dyn Validate<T>,
) -> &mut Self
pub fn set_deserialize_if<T>( &mut self, condition: &'static dyn Validate<T>, ) -> &mut Self
Sets a “deserialize if” condition for the type.
Sourcepub fn set_secret(&mut self) -> &mut Self
pub fn set_secret(&mut self) -> &mut Self
Marks the value as secret.
Sourcepub fn set_items<T: 'static>(
&mut self,
items: &impl DeserializeParam<T>,
) -> &mut Self
pub fn set_items<T: 'static>( &mut self, items: &impl DeserializeParam<T>, ) -> &mut Self
Adds a description of array items. This only makes sense for params accepting array input.
Sourcepub fn set_entries<K: 'static, V: 'static>(
&mut self,
keys: &impl DeserializeParam<K>,
values: &impl DeserializeParam<V>,
) -> &mut Self
pub fn set_entries<K: 'static, V: 'static>( &mut self, keys: &impl DeserializeParam<K>, values: &impl DeserializeParam<V>, ) -> &mut Self
Adds a description of keys and values. This only makes sense for params accepting object input.
Sourcepub fn set_fallback<T: 'static>(&mut self, fallback: &impl DeserializeParam<T>)
pub fn set_fallback<T: 'static>(&mut self, fallback: &impl DeserializeParam<T>)
Adds a fallback deserializer description.
Trait Implementations§
Source§impl Clone for TypeDescription
impl Clone for TypeDescription
Source§fn clone(&self) -> TypeDescription
fn clone(&self) -> TypeDescription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more