pub struct ImageFrame { /* private fields */ }Expand description
One image the viewer can show.
Implementations§
Source§impl ImageFrame
impl ImageFrame
Sourcepub fn new(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
pub fn new(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
id is the image’s own identity, never its place in the list.
Sourcepub fn source(self, source: impl Into<SharedString>) -> Self
pub fn source(self, source: impl Into<SharedString>) -> Self
Where the image came from, shown whenever it is not on screen.
Sourcepub fn natural(self, width: u32, height: u32) -> Self
pub fn natural(self, width: u32, height: u32) -> Self
The source’s own pixel dimensions.
Without this the viewer says the size is unknown and refuses to scale, because a scale nobody can compute is not a scale.
pub fn state(self, state: ImageState) -> Self
The host could not supply this image, and this is why.
Sourcepub fn failed(self, reason: impl Into<SharedString>) -> Self
pub fn failed(self, reason: impl Into<SharedString>) -> Self
The bytes arrived and could not be read, and this is why.
pub fn loading(self) -> Self
pub fn id(&self) -> &SharedString
pub fn label(&self) -> &SharedString
Trait Implementations§
Source§impl Clone for ImageFrame
impl Clone for ImageFrame
Source§fn clone(&self) -> ImageFrame
fn clone(&self) -> ImageFrame
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 ImageFrame
impl Debug for ImageFrame
impl Eq for ImageFrame
Source§impl PartialEq for ImageFrame
impl PartialEq for ImageFrame
impl StructuralPartialEq for ImageFrame
Auto Trait Implementations§
impl Freeze for ImageFrame
impl RefUnwindSafe for ImageFrame
impl Send for ImageFrame
impl Sync for ImageFrame
impl Unpin for ImageFrame
impl UnsafeUnpin for ImageFrame
impl UnwindSafe for ImageFrame
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
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§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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more