Struct ImageViewer
pub struct ImageViewer { /* private fields */ }Expand description
Image viewer component.
Handles async loading, caching, and error states for images.
See ImageSource for all supported image sources.
§Example
fn app() -> impl IntoElement {
let source: ImageSource = (
"rust-logo",
include_bytes!("../../../examples/rust_logo.png"),
)
.into();
ImageViewer::new(source)
}§Preview
Implementations§
§impl ImageViewer
impl ImageViewer
pub fn new(source: impl Into<ImageSource>) -> ImageViewer
§impl ImageViewer
impl ImageViewer
pub fn corner_radius( self, corner_radius: impl Into<CornerRadius>, ) -> ImageViewer
Trait Implementations§
§impl AccessibilityExt for ImageViewer
impl AccessibilityExt for ImageViewer
fn get_accessibility_data(&mut self) -> &mut AccessibilityData
fn accessibility(self, accessibility: AccessibilityData) -> Self
fn a11y_id(self, a11y_id: impl Into<Option<NodeId>>) -> Self
fn a11y_focusable(self, a11y_focusable: impl Into<Focusable>) -> Self
fn a11y_auto_focus(self, a11y_auto_focus: impl Into<bool>) -> Self
fn a11y_member_of(self, a11y_member_of: impl Into<NodeId>) -> Self
fn a11y_role(self, a11y_role: impl Into<Role>) -> Self
fn a11y_alt(self, value: impl Into<Box<str>>) -> Self
fn a11y_builder(self, with: impl FnOnce(&mut Node)) -> Self
§impl ChildrenExt for ImageViewer
impl ChildrenExt for ImageViewer
§fn get_children(&mut self) -> &mut Vec<Element>
fn get_children(&mut self) -> &mut Vec<Element>
Returns a mutable reference to the internal children vector. Read more
§fn children(self, children: impl IntoIterator<Item = Element>) -> Self
fn children(self, children: impl IntoIterator<Item = Element>) -> Self
§fn maybe_child<C>(self, child: Option<C>) -> Selfwhere
C: IntoElement,
fn maybe_child<C>(self, child: Option<C>) -> Selfwhere
C: IntoElement,
§fn child<C>(self, child: C) -> Selfwhere
C: IntoElement,
fn child<C>(self, child: C) -> Selfwhere
C: IntoElement,
Appends a single child element. Read more
§impl Component for ImageViewer
impl Component for ImageViewer
fn render(&self) -> impl IntoElement
fn render_key(&self) -> DiffKey
§impl ContainerSizeExt for ImageViewer
impl ContainerSizeExt for ImageViewer
§impl ContainerWithContentExt for ImageViewer
impl ContainerWithContentExt for ImageViewer
fn direction(self, direction: Direction) -> Self
fn main_align(self, main_align: Alignment) -> Self
fn cross_align(self, cross_align: Alignment) -> Self
fn spacing(self, spacing: impl Into<f32>) -> Self
fn content(self, content: Content) -> Self
fn center(self) -> Self
fn offset_x(self, offset_x: impl Into<f32>) -> Self
fn offset_y(self, offset_y: impl Into<f32>) -> Self
fn vertical(self) -> Self
fn horizontal(self) -> Self
§impl EffectExt for ImageViewer
impl EffectExt for ImageViewer
fn get_effect(&mut self) -> &mut EffectData
fn effect(self, effect: EffectData) -> Self
fn overflow(self, overflow: impl Into<Overflow>) -> Self
fn blur(self, blur: impl Into<f32>) -> Self
fn rotation(self, rotation: impl Into<f32>) -> Self
fn opacity(self, opacity: impl Into<f32>) -> Self
fn scale(self, scale: impl Into<Scale>) -> Self
§impl ImageExt for ImageViewer
impl ImageExt for ImageViewer
fn get_image_data(&mut self) -> &mut ImageData
fn image_data(self, image_data: ImageData) -> Self
fn sampling_mode(self, sampling_mode: SamplingMode) -> Self
fn aspect_ratio(self, aspect_ratio: AspectRatio) -> Self
fn image_cover(self, image_cover: ImageCover) -> Self
§impl KeyExt for ImageViewer
impl KeyExt for ImageViewer
§impl LayoutExt for ImageViewer
impl LayoutExt for ImageViewer
fn get_layout(&mut self) -> &mut LayoutData
fn layout(self, layout: LayoutData) -> Self
§impl PartialEq for ImageViewer
impl PartialEq for ImageViewer
impl StructuralPartialEq for ImageViewer
Auto Trait Implementations§
impl !Freeze for ImageViewer
impl !RefUnwindSafe for ImageViewer
impl !Send for ImageViewer
impl !Sync for ImageViewer
impl Unpin for ImageViewer
impl UnsafeUnpin for ImageViewer
impl !UnwindSafe for ImageViewer
Blanket Implementations§
§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<T> ComponentKey for Twhere
T: Component,
impl<T> ComponentKey for Twhere
T: Component,
fn default_key(&self) -> DiffKey
§impl<T> ComponentProps for T
impl<T> ComponentProps for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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