Struct ratatui_image::StatefulImage
source · pub struct StatefulImage { /* private fields */ }
Expand description
Resizeable image widget that uses a StatefulProtocol state.
This stateful widget reacts to area resizes and resizes its image data accordingly.
struct App {
image_state: Box<dyn StatefulProtocol>,
}
fn ui(f: &mut Frame<'_>, app: &mut App) {
let image = StatefulImage::new(None).resize(Resize::Crop);
f.render_stateful_widget(
image,
f.size(),
&mut app.image_state,
);
}
Implementations§
source§impl StatefulImage
impl StatefulImage
pub fn new(background_color: Option<Rgb<u8>>) -> StatefulImage
pub fn resize(self, resize: Resize) -> StatefulImage
Trait Implementations§
source§impl StatefulWidget for StatefulImage
impl StatefulWidget for StatefulImage
Auto Trait Implementations§
impl Freeze for StatefulImage
impl RefUnwindSafe for StatefulImage
impl Send for StatefulImage
impl Sync for StatefulImage
impl Unpin for StatefulImage
impl UnwindSafe for StatefulImage
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