pub trait IntoImageSource<M> {
// Required method
fn into_image_source(self) -> Reactive<ImageSource>;
}Expand description
Disjoint-marker conversion into an image source (the same shape as
IntoText, and for the same coherence reason): a staged name, a byte
buffer, a decoded Bitmap, a Signal, or a closure all convert, each
under its own marker.
A blanket impl<S: Into<ImageSource>> over the existing
IntoReactive would be ambiguous for ImageSource itself (the
static blanket and the converting one would both apply and leave the marker unconstrained),
so the conversions are spelled per concrete type instead.
Required Methods§
fn into_image_source(self) -> Reactive<ImageSource>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl IntoImageSource<ImageValueMark> for &Bitmap
A decoded image draws by id, so several nodes (and the canvas) share one decode.
A decoded handle. The piece keeps a clone alive for the node’s life: the closure below owns
it, the binding owns the closure, and the node’s scope owns the binding, so the toolkit’s
image outlives the view that shows it however the app juggles its own handle. Without this an
image(&bitmap) would carry only the id, and on the web the <img> would point at an object
URL that release_image had already revoked.
impl IntoImageSource<ImageValueMark> for &Bitmap
A decoded image draws by id, so several nodes (and the canvas) share one decode.
A decoded handle. The piece keeps a clone alive for the node’s life: the closure below owns
it, the binding owns the closure, and the node’s scope owns the binding, so the toolkit’s
image outlives the view that shows it however the app juggles its own handle. Without this an
image(&bitmap) would carry only the id, and on the web the <img> would point at an object
URL that release_image had already revoked.