pub trait FieldAccessor {
type Value: Serialize + for<'de> Deserialize<'de>;
// Required method
fn path() -> &'static str;
// Provided method
fn segments() -> Vec<&'static str> { ... }
}Expand description
Trait for type-safe field access without string literals (LEGACY API)
Implement this trait to create compile-time checked field accessors:
ⓘ
struct TotalVolume;
impl FieldAccessor for TotalVolume {
type Value = u64;
fn path() -> &'static str { "total_volume" }
}Or use the field_accessor! macro for convenience.
DEPRECATED: Consider using the new field! macro instead for cleaner syntax.
Required Associated Types§
Sourcetype Value: Serialize + for<'de> Deserialize<'de>
type Value: Serialize + for<'de> Deserialize<'de>
The type of the field value
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.