pub struct ThreadImage { /* private fields */ }Expand description
A widget that uses a custom ThreadProtocol as state to offload resizing and encoding to a background thread.
Implementations§
Source§impl ThreadImage
impl ThreadImage
Sourcepub fn resize(self, resize: Resize) -> ThreadImage
pub fn resize(self, resize: Resize) -> ThreadImage
Examples found in repository?
examples/async.rs (line 116)
107 108 109 110 111 112 113 114 115 116 117 118 119
fn ui(f: &mut Frame<'_>, app: &mut App) {
let area = f.area();
let block = Block::default().borders(Borders::ALL).title("Async test");
f.render_widget(
Paragraph::new("PartiallyHiddenScreenshotParagraphBackground\n".repeat(10)),
block.inner(area),
);
let image = ThreadImage::default().resize(Resize::Fit(None));
f.render_stateful_widget(image, block.inner(area), &mut app.async_state);
f.render_widget(block, area);
}Trait Implementations§
Source§impl Default for ThreadImage
impl Default for ThreadImage
Source§impl StatefulWidget for ThreadImage
impl StatefulWidget for ThreadImage
Auto Trait Implementations§
impl Freeze for ThreadImage
impl RefUnwindSafe for ThreadImage
impl Send for ThreadImage
impl Sync for ThreadImage
impl Unpin for ThreadImage
impl UnwindSafe for ThreadImage
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> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().