pub trait FromProp: Sized {
const TYPE_NAME: &'static str;
// Required method
fn from_prop(
pi: &PropInput<'_>,
widget: &str,
prop: &str,
) -> Result<Self, InflateError>;
}Expand description
Convert a resolved prop (PropInput) into a setter’s argument type.
This is the typed edge between the untyped template/hole world and a
widget’s strongly-typed builder. A build closure calls
f32::from_prop(v, ..) to get the value for .spacing(f32). Implement it
for your own prop types so inflatable!-registered widgets can accept them
(mirrors the extensibility of the widget registry itself).
Required Associated Constants§
Sourceconst TYPE_NAME: &'static str
const TYPE_NAME: &'static str
The name shown in a InflateError::PropType when extraction fails.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".