pub struct ImageSrc { /* private fields */ }Expand description
A safe LVGL image source, constructible only from 'static data.
LVGL recognizes three flavours of source pointer: an image descriptor
(lv_image_dsc_t), a built-in symbol byte string (LV_SYMBOL_*), and
a NUL-terminated filesystem path (FS driver required). All three are
covered with type-safe constructors.
Implementations§
Source§impl ImageSrc
impl ImageSrc
Sourcepub fn from_dsc(dsc: *const ImageDsc) -> Self
pub fn from_dsc(dsc: *const ImageDsc) -> Self
Wrap an LVGL image descriptor by pointer. The pointed-to data must
outlive any widget using this source — 'static in practice.
Typical call: ImageSrc::from_dsc(core::ptr::addr_of!(images::badge))
where images::badge is a generated extern "C" static image.
Sourcepub fn from_symbol(sym: &'static [u8]) -> Self
pub fn from_symbol(sym: &'static [u8]) -> Self
Wrap a NUL-terminated symbol byte string (e.g. LV_SYMBOL_OK).
Trait Implementations§
impl Copy for ImageSrc
impl Send for ImageSrc
impl Sync for ImageSrc
Auto Trait Implementations§
impl Freeze for ImageSrc
impl RefUnwindSafe for ImageSrc
impl Unpin for ImageSrc
impl UnsafeUnpin for ImageSrc
impl UnwindSafe for ImageSrc
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