pub struct QRCode<'a, Theme = Theme>where
Theme: Catalog,{ /* private fields */ }
Expand description
A type of matrix barcode consisting of squares arranged in a grid which can be read by an imaging device, such as a camera.
§Example
use iced::widget::qr_code;
struct State {
data: qr_code::Data,
}
#[derive(Debug, Clone)]
enum Message {
// ...
}
fn view(state: &State) -> Element<'_, Message> {
qr_code(&state.data).into()
}
Implementations§
Source§impl<'a, Theme> QRCode<'a, Theme>where
Theme: Catalog,
impl<'a, Theme> QRCode<'a, Theme>where
Theme: Catalog,
Sourcepub fn cell_size(self, cell_size: impl Into<Pixels>) -> QRCode<'a, Theme>
pub fn cell_size(self, cell_size: impl Into<Pixels>) -> QRCode<'a, Theme>
Sets the size of the squares of the grid cell of the QRCode
.
Sourcepub fn total_size(self, total_size: impl Into<Pixels>) -> QRCode<'a, Theme>
pub fn total_size(self, total_size: impl Into<Pixels>) -> QRCode<'a, Theme>
Sets the size of the entire QRCode
.
Trait Implementations§
Source§impl<'a, Message, Theme> From<QRCode<'a, Theme>> for Element<'a, Message, Theme, Renderer<Renderer, Renderer>>where
Theme: Catalog + 'a,
impl<'a, Message, Theme> From<QRCode<'a, Theme>> for Element<'a, Message, Theme, Renderer<Renderer, Renderer>>where
Theme: Catalog + 'a,
Source§impl<Message, Theme> Widget<Message, Theme, Renderer<Renderer, Renderer>> for QRCode<'_, Theme>where
Theme: Catalog,
impl<Message, Theme> Widget<Message, Theme, Renderer<Renderer, Renderer>> for QRCode<'_, Theme>where
Theme: Catalog,
Source§fn layout(
&self,
_tree: &mut Tree,
_renderer: &Renderer<Renderer, Renderer>,
_limits: &Limits,
) -> Node
fn layout( &self, _tree: &mut Tree, _renderer: &Renderer<Renderer, Renderer>, _limits: &Limits, ) -> Node
Source§fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer<Renderer, Renderer>,
theme: &Theme,
_style: &Style,
layout: Layout<'_>,
_cursor: Cursor,
_viewport: &Rectangle,
)
fn draw( &self, tree: &Tree, renderer: &mut Renderer<Renderer, Renderer>, theme: &Theme, _style: &Style, layout: Layout<'_>, _cursor: Cursor, _viewport: &Rectangle, )
Draws the
Widget
using the associated Renderer
.§fn operate(
&self,
_state: &mut Tree,
_layout: Layout<'_>,
_renderer: &Renderer,
_operation: &mut dyn Operation,
)
fn operate( &self, _state: &mut Tree, _layout: Layout<'_>, _renderer: &Renderer, _operation: &mut dyn Operation, )
§fn update(
&mut self,
_state: &mut Tree,
_event: &Event,
_layout: Layout<'_>,
_cursor: Cursor,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>,
_viewport: &Rectangle,
)
fn update( &mut self, _state: &mut Tree, _event: &Event, _layout: Layout<'_>, _cursor: Cursor, _renderer: &Renderer, _clipboard: &mut dyn Clipboard, _shell: &mut Shell<'_, Message>, _viewport: &Rectangle, )
§fn mouse_interaction(
&self,
_state: &Tree,
_layout: Layout<'_>,
_cursor: Cursor,
_viewport: &Rectangle,
_renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, _state: &Tree, _layout: Layout<'_>, _cursor: Cursor, _viewport: &Rectangle, _renderer: &Renderer, ) -> Interaction
Auto Trait Implementations§
impl<'a, Theme> Freeze for QRCode<'a, Theme>
impl<'a, Theme = Theme> !RefUnwindSafe for QRCode<'a, Theme>
impl<'a, Theme = Theme> !Send for QRCode<'a, Theme>
impl<'a, Theme = Theme> !Sync for QRCode<'a, Theme>
impl<'a, Theme> Unpin for QRCode<'a, Theme>
impl<'a, Theme = Theme> !UnwindSafe for QRCode<'a, Theme>
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> 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