diff options
author | 2021-12-10 20:15:27 +0100 | |
---|---|---|
committer | 2021-12-10 23:33:58 +0100 | |
commit | a7bcd65bb82a2640e10cbe25bf24bc003d059857 (patch) | |
tree | 99e9991ba33d8f808d3bba76fae813182977c814 /native/src/image.rs | |
parent | 8cbba944581a81931848352ec45646d882d9b3d0 (diff) | |
download | iced-a7bcd65bb82a2640e10cbe25bf24bc003d059857.tar.gz iced-a7bcd65bb82a2640e10cbe25bf24bc003d059857.tar.bz2 iced-a7bcd65bb82a2640e10cbe25bf24bc003d059857.zip |
Decouple the image Handle type from the iced_native implementation
Diffstat (limited to 'native/src/image.rs')
-rw-r--r-- | native/src/image.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/native/src/image.rs b/native/src/image.rs index 00379417..43bba4f1 100644 --- a/native/src/image.rs +++ b/native/src/image.rs @@ -115,10 +115,15 @@ impl std::fmt::Debug for Data { /// /// [renderer]: crate::renderer pub trait Renderer: crate::Renderer { + /// The image Handle to be displayed. Iced exposes its own default implementation of a [`Handle`] + /// + /// [`Handle`]: Self::Handle + type Handle: Clone + Hash; + /// Returns the dimensions of an image for the given [`Handle`]. - fn dimensions(&self, handle: &Handle) -> (u32, u32); + fn dimensions(&self, handle: &Self::Handle) -> (u32, u32); /// Draws an image with the given [`Handle`] and inside the provided /// `bounds`. - fn draw(&mut self, handle: Handle, bounds: Rectangle); + fn draw(&mut self, handle: Self::Handle, bounds: Rectangle); } |