pub trait Wiring<M> {
// Required method
fn message(&mut self, name: &str, payload: Payload) -> Option<Handler<M>>;
// Provided method
fn asset(&mut self, path: &str) -> Option<Picture> { ... }
}Expand description
What an application supplies a form that this crate cannot: its own message type, and its own pictures.
A plain closure implements this, which is all most forms need. Implement it on a type when the form also names pictures.
Required Methods§
Provided Methods§
Sourcefn asset(&mut self, path: &str) -> Option<Picture>
fn asset(&mut self, path: &str) -> Option<Picture>
Loads a picture, by a path relative to the form file.
The default has none, so a form naming a picture in an application that
supplied no loader fails with the path in the message rather than drawing
a hole. This crate decodes nothing and does not depend on denise-image:
that keeps a board with its pictures compiled in from linking a decoder it
will never call.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".