pub trait KpTrait<R, V, Root, Value, MutRoot, MutValue>: Readable<Root, Value> + Writable<MutRoot, MutValue> {
// Required method
fn then<SV, SubValue, MutSubValue, Next>(
self,
next: Next,
) -> impl KeyPath<Root, SubValue, MutRoot, MutSubValue>
where Self: Sized,
SubValue: Borrow<SV>,
MutSubValue: BorrowMut<SV>,
Next: Readable<Value, SubValue> + Writable<MutValue, MutSubValue> + Clone;
// Provided methods
fn type_id_of_root() -> TypeId
where R: 'static { ... }
fn type_id_of_value() -> TypeId
where V: 'static { ... }
}Expand description
Logical root/value type identity and composition for a keypath.
Required Methods§
Sourcefn then<SV, SubValue, MutSubValue, Next>(
self,
next: Next,
) -> impl KeyPath<Root, SubValue, MutRoot, MutSubValue>
fn then<SV, SubValue, MutSubValue, Next>( self, next: Next, ) -> impl KeyPath<Root, SubValue, MutRoot, MutSubValue>
Chain with a keypath over this segment’s value (Value / MutValue are the link types).
Next must read/write from the current value. The returned type is opaque at the trait
level; concrete crates (for example rust-key-paths Kp) choose their own struct.
Provided Methods§
Sourcefn type_id_of_root() -> TypeIdwhere
R: 'static,
fn type_id_of_root() -> TypeIdwhere
R: 'static,
TypeId of the logical root type R.
Sourcefn type_id_of_value() -> TypeIdwhere
V: 'static,
fn type_id_of_value() -> TypeIdwhere
V: 'static,
TypeId of the logical value type V.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".