pub struct FixedImage<'a> { /* private fields */ }Expand description
Fixed size image widget that uses FixedBackend.
The widget does not react to area resizes, and is not even guaranteed to not overdraw. Its advantage is that the FixedBackend it uses needs only one initial resize.
struct App {
image_static: Box<dyn FixedBackend>,
}
fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
let image = FixedImage::new(app.image_static.as_ref());
f.render_widget(image, f.size());
}Implementations§
Source§impl<'a> FixedImage<'a>
impl<'a> FixedImage<'a>
pub fn new(image: &'a dyn FixedBackend) -> FixedImage<'a>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for FixedImage<'a>
impl<'a> !RefUnwindSafe for FixedImage<'a>
impl<'a> Send for FixedImage<'a>
impl<'a> Sync for FixedImage<'a>
impl<'a> Unpin for FixedImage<'a>
impl<'a> !UnwindSafe for FixedImage<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more