pub trait Attribute: Sized {
// Required methods
fn schema() -> Value;
fn read(value: &Value) -> Option<Self>;
fn write(&self) -> Value;
// Provided method
fn required() -> bool { ... }
}Expand description
A type a resource attribute can hold.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: Attribute> Attribute for Option<T>
Option<T> — the member may be absent, and null reads as None.
impl<T: Attribute> Attribute for Option<T>
Option<T> — the member may be absent, and null reads as None.