pub struct ImageResource {
pub data: Bytes,
pub mimetype: String,
}Expand description
Data type representing an image
Fields§
§data: BytesRaw image data
mimetype: StringMime type of the image, e.g. image/png
Implementations§
Source§impl ImageResource
impl ImageResource
Sourcepub fn to_data_uri(&self) -> String
pub fn to_data_uri(&self) -> String
Encode the image data as base 64 and embed it into a data: URI,
e.g. data:image/png;base64,iVBORw0....
Trait Implementations§
Source§impl Debug for ImageResource
impl Debug for ImageResource
Source§impl PartialEq for ImageResource
impl PartialEq for ImageResource
impl Eq for ImageResource
impl StructuralPartialEq for ImageResource
Auto Trait Implementations§
impl !Freeze for ImageResource
impl RefUnwindSafe for ImageResource
impl Send for ImageResource
impl Sync for ImageResource
impl Unpin for ImageResource
impl UnwindSafe for ImageResource
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.