pub trait IntoProp<T> {
// Required method
fn into_prop(self) -> Prop<T>;
}Expand description
Anything a widget property accepts: a value of type T, or a closure
that returns one.
Plain values work for the property types this crate uses, and a string
slice works where a String is expected. Any FnMut() -> T closure
works too: it runs in an effect, so it reruns when a signal it read
changes.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl IntoProp<IconSource> for &Path
An SVG or PNG file.
impl IntoProp<IconSource> for &Path
An SVG or PNG file.
fn into_prop(self) -> Prop<IconSource>
Source§impl IntoProp<IconSource> for &str
An icon name, such as "audio-volume-high".
impl IntoProp<IconSource> for &str
An icon name, such as "audio-volume-high".
fn into_prop(self) -> Prop<IconSource>
Source§impl IntoProp<IconSource> for PathBuf
An SVG or PNG file.
impl IntoProp<IconSource> for PathBuf
An SVG or PNG file.
fn into_prop(self) -> Prop<IconSource>
Source§impl IntoProp<IconSource> for String
An icon name, as tray items send them.
impl IntoProp<IconSource> for String
An icon name, as tray items send them.
fn into_prop(self) -> Prop<IconSource>
Source§impl<T> IntoProp<Option<T>> for Option<T>
Any Option passes as a plain value, as None or Some(value). It
can sit beside the closure impl for the same reason the ones below do.
impl<T> IntoProp<Option<T>> for Option<T>
Any Option passes as a plain value, as None or Some(value). It
can sit beside the closure impl for the same reason the ones below do.
Implementors§
impl IntoProp<Adjust> for Adjust
impl IntoProp<Align> for Align
impl IntoProp<Anchors> for Anchors
impl IntoProp<Anchors> for Edge
impl IntoProp<CaptureSource> for CaptureSource
impl IntoProp<CursorShape> for CursorShape
impl IntoProp<Elide> for Elide
impl IntoProp<Fit> for Fit
impl IntoProp<IconSource> for IconSource
impl IntoProp<ImageTransition> for ImageTransition
impl IntoProp<Justify> for Justify
impl IntoProp<KeyboardFocus> for KeyboardFocus
impl IntoProp<Layer> for Layer
impl IntoProp<Margins> for Margins
impl IntoProp<Option<Color>> for Color
impl IntoProp<Option<Region>> for Region
impl IntoProp<Option<Style>> for Style
impl IntoProp<Style> for Style
impl IntoProp<Transition> for Transition
impl<T, F> IntoProp<T> for Fwhere
F: FnMut() -> T + 'static,
impl<T> IntoProp<T> for Prop<T>
A property taken from one widget can be handed to another, as a widget built from others passes its own on.