pub trait ShapeStyleArg {
// Required method
fn foreground_style(self, view: View) -> View;
}Expand description
Anything foregroundStyle accepts — Swift’s some ShapeStyle.
Implemented rather than derived, because each one reaches a different
binding; adding a style is one impl.
§Leading dots do not work here
.foreground_style(.blue) does not compile, and cannot. A leading dot
lowers to Into::into(dot::Blue), which needs a concrete expected type to
resolve against; a generic parameter gives it none, and Rust will not search
impls backwards to find the one type that is both From<dot::Blue> and
ShapeStyleArg. Name the style — SystemColor::Blue — or use a modifier
whose parameter is that one type, such as
foreground_style_hierarchical.
Required Methods§
Sourcefn foreground_style(self, view: View) -> View
fn foreground_style(self, view: View) -> View
Apply this style to view.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".