Struct Viewer
pub struct Viewer<Handle> { /* private fields */ }
Expand description
A frame that displays an image with the ability to zoom in/out and pan.
Implementations§
§impl<Handle> Viewer<Handle>
impl<Handle> Viewer<Handle>
pub fn filter_method(self, filter_method: FilterMethod) -> Viewer<Handle>
pub fn filter_method(self, filter_method: FilterMethod) -> Viewer<Handle>
Sets the FilterMethod
of the Viewer
.
pub fn content_fit(self, content_fit: ContentFit) -> Viewer<Handle>
pub fn content_fit(self, content_fit: ContentFit) -> Viewer<Handle>
Sets the ContentFit
of the Viewer
.
pub fn max_scale(self, max_scale: f32) -> Viewer<Handle>
pub fn max_scale(self, max_scale: f32) -> Viewer<Handle>
Sets the max scale applied to the image of the Viewer
.
Default is 10.0
pub fn min_scale(self, min_scale: f32) -> Viewer<Handle>
pub fn min_scale(self, min_scale: f32) -> Viewer<Handle>
Sets the min scale applied to the image of the Viewer
.
Default is 0.25
pub fn scale_step(self, scale_step: f32) -> Viewer<Handle>
pub fn scale_step(self, scale_step: f32) -> Viewer<Handle>
Sets the percentage the image of the Viewer
will be scaled by
when zoomed in / out.
Default is 0.10
Trait Implementations§
§impl<'a, Message, Theme, Renderer, Handle> From<Viewer<Handle>> for Element<'a, Message, Theme, Renderer>
impl<'a, Message, Theme, Renderer, Handle> From<Viewer<Handle>> for Element<'a, Message, Theme, Renderer>
§impl<Message, Theme, Renderer, Handle> Widget<Message, Theme, Renderer> for Viewer<Handle>
impl<Message, Theme, Renderer, Handle> Widget<Message, Theme, Renderer> for Viewer<Handle>
§fn update(
&mut self,
tree: &mut Tree,
event: &Event,
layout: Layout<'_>,
cursor: Cursor,
renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
_viewport: &Rectangle,
)
fn update( &mut self, tree: &mut Tree, event: &Event, layout: Layout<'_>, cursor: Cursor, renderer: &Renderer, _clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, _viewport: &Rectangle, )
§fn mouse_interaction(
&self,
tree: &Tree,
layout: Layout<'_>,
cursor: Cursor,
_viewport: &Rectangle,
_renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, tree: &Tree, layout: Layout<'_>, cursor: Cursor, _viewport: &Rectangle, _renderer: &Renderer, ) -> Interaction
§fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer,
_theme: &Theme,
_style: &Style,
layout: Layout<'_>,
_cursor: Cursor,
_viewport: &Rectangle,
)
fn draw( &self, tree: &Tree, renderer: &mut Renderer, _theme: &Theme, _style: &Style, layout: Layout<'_>, _cursor: Cursor, _viewport: &Rectangle, )
Draws the
Widget
using the associated Renderer
.Auto Trait Implementations§
impl<Handle> Freeze for Viewer<Handle>where
Handle: Freeze,
impl<Handle> RefUnwindSafe for Viewer<Handle>where
Handle: RefUnwindSafe,
impl<Handle> Send for Viewer<Handle>where
Handle: Send,
impl<Handle> Sync for Viewer<Handle>where
Handle: Sync,
impl<Handle> Unpin for Viewer<Handle>where
Handle: Unpin,
impl<Handle> UnwindSafe for Viewer<Handle>where
Handle: UnwindSafe,
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<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> DowncastSync for T
impl<T> DowncastSync for T
§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<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Turns some type into the initial state of some
Application
.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