Skip to main content

ImageStream

Struct ImageStream 

Source
pub struct ImageStream { /* private fields */ }
Expand description

The listening half of an image. Flutter ImageStream.

A stream exists before its completer does, because a provider may have to look in the cache or start a decode first. Listeners added in the meantime are held here and handed over when set_completer arrives.

Implementations§

Source§

impl ImageStream

Source

pub fn new(app: &mut App) -> Retained<Handle<ImageStream>>

Creates a stream with no completer yet.

Source

pub fn completer( self: Handle<ImageStream>, app: &App, ) -> Option<Handle<ImageStreamCompleter>>

The completer, once one has been assigned.

Two streams for the same image share a completer, which is how the cache makes one decode serve every widget showing it. Comparing these is how a widget tells whether the image it resolved to has actually changed.

Source

pub fn dispose(self: Handle<ImageStream>, app: &mut App)

Releases the stream and unregisters its listeners. The resolving consumer owns this call.

Source

pub fn set_completer( self: Handle<ImageStream>, app: &mut App, completer: Retained<Handle<ImageStreamCompleter>>, )

Assigns the completer, handing it every listener added while there was none.

§Panics

Panics if a completer was already assigned, as Dart’s assert does; a stream resolves once.

Source

pub fn add_listener( self: Handle<ImageStream>, app: &mut App, listener: ImageStreamListener, )

Adds a listener now, or holds it until the completer arrives.

Source

pub fn remove_listener( self: Handle<ImageStream>, app: &mut App, listener: &ImageStreamListener, )

Removes a listener, whether it is waiting here or already on the completer.

Trait Implementations§

Source§

impl Default for ImageStream

Source§

fn default() -> ImageStream

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> 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, 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>