pub struct Image { /* private fields */ }Expand description
Image component.
Implementations§
Source§impl Image
impl Image
Sourcepub fn from_data(data: Vec<u8>, options: ImageOptions) -> Self
pub fn from_data(data: Vec<u8>, options: ImageOptions) -> Self
Create an image from data.
Sourcepub fn from_url(url: &str, options: ImageOptions) -> Self
pub fn from_url(url: &str, options: ImageOptions) -> Self
Create an image from a URL.
Sourcepub fn set_options(&mut self, options: ImageOptions)
pub fn set_options(&mut self, options: ImageOptions)
Set options.
Sourcepub fn set_alt_text(&mut self, alt_text: &str)
pub fn set_alt_text(&mut self, alt_text: &str)
Set alt text.
Sourcepub fn set_theme(&mut self, theme: ImageTheme)
pub fn set_theme(&mut self, theme: ImageTheme)
Set theme.
Sourcepub fn get_dimensions(&self) -> Option<(u32, u32)>
pub fn get_dimensions(&self) -> Option<(u32, u32)>
Get image dimensions if available.
Sourcepub fn set_inline_visible(&self, visible: bool)
pub fn set_inline_visible(&self, visible: bool)
Hide terminal graphics while retaining an attachment placeholder.
Trait Implementations§
Source§impl Component for Image
impl Component for Image
Source§fn render(&self, width: usize) -> Vec<String>
fn render(&self, width: usize) -> Vec<String>
Render the component to lines for the given viewport width. Read more
Source§fn invalidate(&self)
fn invalidate(&self)
Invalidate any cached rendering state.
Called when theme changes or when component needs to re-render from scratch.
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Downcast to Any for runtime type checking.
This enables the layout system to check for LayoutNodeProvider.
Source§fn handle_input(&self, _data: &str) -> bool
fn handle_input(&self, _data: &str) -> bool
Optional handler for keyboard input when component has focus. Read more
Source§fn wants_key_release(&self) -> bool
fn wants_key_release(&self) -> bool
If true, component receives key release events (Kitty protocol).
Default is false - release events are filtered out.
Auto Trait Implementations§
impl !Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
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