Skip to main content

MemoryImage

Struct MemoryImage 

Source
pub struct MemoryImage {
    pub bytes: ImageBytes,
    pub scale: f64,
}
Expand description

Decodes an image from an immutable buffer. Flutter MemoryImage.

Fields§

§bytes: ImageBytes

The source whose identity is used for cache lookup.

§scale: f64

Linear pixels per logical point in the decoded image.

Implementations§

Source§

impl MemoryImage

Source

pub fn new(bytes: Arc<[u8]>) -> MemoryImage

Creates a provider retaining the shared allocation; clone the Arc to reuse a decode.

Source

pub fn from_static(bytes: &'static [u8]) -> MemoryImage

Creates a provider for static data without copying it to establish a cache key.

Source

pub fn scale(self, scale: f64) -> MemoryImage

Dart MemoryImage(scale:).

Trait Implementations§

Source§

impl Clone for MemoryImage

Source§

fn clone(&self) -> MemoryImage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemoryImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl ImageProvider for MemoryImage

Source§

fn key(&self, _configuration: &ImageConfiguration) -> ImageCacheKey

What names this image in the cache. Flutter obtainKey. Read more
Source§

fn load_image( &self, app: &mut App, key: &ImageCacheKey, ) -> Retained<Handle<ImageStreamCompleter>>

Starts decoding, answering with the completer that will carry the frame. Flutter loadImage. Read more
Source§

fn resolve( &self, app: &mut App, configuration: &ImageConfiguration, ) -> Retained<Handle<ImageStream>>

The stream for this image, sharing whatever the cache already has. Flutter resolve.

Auto Trait Implementations§

§

impl Forget for MemoryImage

§

impl Freeze for MemoryImage
where &'static [u8]: Freeze, *const ArcInner<[u8]> is !null: Freeze, PhantomData<ArcInner<[u8]>>: Freeze,

§

impl Move for MemoryImage

§

impl RefUnwindSafe for MemoryImage

§

impl Send for MemoryImage
where &'static [u8]: Send, Arc<[u8]>: Send,

§

impl Sync for MemoryImage
where Arc<[u8]>: Sync,

§

impl Unpin for MemoryImage
where &'static [u8]: Unpin, Arc<[u8]>: Unpin,

§

impl UnsafeUnpin for MemoryImage
where &'static [u8]: UnsafeUnpin, *const ArcInner<[u8]> is !null: UnsafeUnpin, PhantomData<ArcInner<[u8]>>: UnsafeUnpin,

§

impl UnwindSafe for MemoryImage
where &'static [u8]: UnwindSafe, Arc<[u8]>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,