DynamicHasField

Trait DynamicHasField 

Source
pub trait DynamicHasField {
    type Inner;

    // Required method
    fn resolve_path<P: OwnedPathType>(p: P, name: &str) -> P;
}
Available on crate feature resolve-path only.
Expand description

A trait to declare that a type has fields with dynamic names, such as DirChildren, DirDescendants, etc.

This is used to resolve paths with resolve_path, particularly with the "name" and ${expr} syntaxes.

Required Associated Types§

Source

type Inner

The type of the field.

Required Methods§

Source

fn resolve_path<P: OwnedPathType>(p: P, name: &str) -> P

How to resolve the path for the field, from the path of Self, given the name passed into the resolve_path! macro.

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.

Implementations on Foreign Types§

Source§

impl<T> DynamicHasField for Option<T>
where T: DynamicHasField,

Implementors§