pub trait ImageBuilder: Sized {
// Required methods
fn content_mode(self, m: ContentMode) -> Self;
fn fit(self) -> Self;
fn fill(self) -> Self;
fn stretch(self) -> Self;
fn aspect_ratio(self, ratio: f64) -> Self;
fn decorative(self) -> Self;
fn template(self) -> Self;
}Expand description
Required Methods§
Sourcefn content_mode(self, m: ContentMode) -> Self
fn content_mode(self, m: ContentMode) -> Self
How the image scales within its frame (default ContentMode::Fit).
Sourcefn fit(self) -> Self
fn fit(self) -> Self
Scale to fit entirely inside the frame, preserving aspect ratio (the default).
Sourcefn fill(self) -> Self
fn fill(self) -> Self
Scale to fill the frame, preserving aspect ratio and cropping the overflow.
Sourcefn aspect_ratio(self, ratio: f64) -> Self
fn aspect_ratio(self, ratio: f64) -> Self
Constrain the view to a width / height ratio (e.g. 16.0 / 9.0).
Sourcefn decorative(self) -> Self
fn decorative(self) -> Self
Mark the image decorative (hidden from accessibility).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".