pub enum ImageBytes {
Static(&'static [u8]),
Shared(Arc<[u8]>),
}Expand description
Immutable encoded bytes whose identity survives widget rebuilds.
Static data is borrowed without allocation. Shared data keeps its allocation alive; cloning either variant preserves identity. Conversion for the host occurs only on a cache miss.
Variants§
Static(&'static [u8])
Bytes embedded in the application, identified by address and length.
An owned buffer, identified by its shared allocation.
Trait Implementations§
Source§impl Clone for ImageBytes
impl Clone for ImageBytes
Source§fn clone(&self) -> ImageBytes
fn clone(&self) -> ImageBytes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageBytes
impl Debug for ImageBytes
impl Eq for ImageBytes
Source§impl Hash for ImageBytes
impl Hash for ImageBytes
Auto Trait Implementations§
impl Forget for ImageBytes
impl Freeze for ImageBytes
impl Move for ImageBytes
impl RefUnwindSafe for ImageBytes
impl Send for ImageBytes
impl Sync for ImageBytes
impl Unpin for ImageBytes
impl UnsafeUnpin for ImageByteswhere
&'static [u8]: UnsafeUnpin,
*const ArcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[u8]>>: UnsafeUnpin,
impl UnwindSafe for ImageBytes
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.