Struct iced_graphics::renderer::Renderer
source · pub struct Renderer<B: Backend, Theme> { /* private fields */ }
Expand description
A backend-agnostic renderer that supports all the built-in widgets.
Implementations§
Trait Implementations§
source§impl<B, T> Renderer for Renderer<B, T>where
B: Backend,
impl<B, T> Renderer for Renderer<B, T>where
B: Backend,
source§fn layout<'a, Message>(
&mut self,
element: &Element<'a, Message, Self>,
limits: &Limits
) -> Node
fn layout<'a, Message>(
&mut self,
element: &Element<'a, Message, Self>,
limits: &Limits
) -> Node
Lays out the elements of a user interface. Read more
source§fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self))
fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self))
Draws the primitives recorded in the given closure in a new layer. Read more
source§fn with_translation(&mut self, translation: Vector, f: impl FnOnce(&mut Self))
fn with_translation(&mut self, translation: Vector, f: impl FnOnce(&mut Self))
Applies a
translation
to the primitives recorded in the given closure.source§fn fill_quad(&mut self, quad: Quad, background: impl Into<Background>)
fn fill_quad(&mut self, quad: Quad, background: impl Into<Background>)
Fills a
Quad
with the provided Background
.source§impl<B, T> Renderer for Renderer<B, T>where
B: Backend + Text,
impl<B, T> Renderer for Renderer<B, T>where
B: Backend + Text,
source§const CHECKMARK_ICON: char = B::CHECKMARK_ICON
const CHECKMARK_ICON: char = B::CHECKMARK_ICON
source§const ARROW_DOWN_ICON: char = B::ARROW_DOWN_ICON
const ARROW_DOWN_ICON: char = B::ARROW_DOWN_ICON
source§fn default_size(&self) -> u16
fn default_size(&self) -> u16
Returns the default size of
Text
.source§fn measure(&self, content: &str, size: u16, font: Font, bounds: Size) -> (f32, f32)
fn measure(&self, content: &str, size: u16, font: Font, bounds: Size) -> (f32, f32)
Measures the text in the given bounds and returns the minimum boundaries
that can fit the contents. Read more
source§impl<B, T> Renderer for Renderer<B, T>where
B: Backend + Image,
impl<B, T> Renderer for Renderer<B, T>where
B: Backend + Image,
source§impl<Message, P, B, T> Widget<Message, Renderer<B, T>> for Canvas<Message, T, P>where
P: Program<Message, T>,
B: Backend,
Available on crate feature canvas
only.
impl<Message, P, B, T> Widget<Message, Renderer<B, T>> for Canvas<Message, T, P>where
P: Program<Message, T>,
B: Backend,
Available on crate feature
canvas
only.source§fn on_event(
&mut self,
tree: &mut Tree,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
_renderer: &Renderer<B, T>,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>
) -> Status
fn on_event(
&mut self,
tree: &mut Tree,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
_renderer: &Renderer<B, T>,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>
) -> Status
source§fn mouse_interaction(
&self,
tree: &Tree,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle,
_renderer: &Renderer<B, T>
) -> Interaction
fn mouse_interaction(
&self,
tree: &Tree,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle,
_renderer: &Renderer<B, T>
) -> Interaction
source§fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer<B, T>,
theme: &T,
_style: &Style,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle
)
fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer<B, T>,
theme: &T,
_style: &Style,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle
)
Draws the
Widget
using the associated Renderer
.source§impl<'a, Message, B, T> Widget<Message, Renderer<B, T>> for QRCode<'a>where
B: Backend,
Available on crate feature qr_code
only.
impl<'a, Message, B, T> Widget<Message, Renderer<B, T>> for QRCode<'a>where
B: Backend,
Available on crate feature
qr_code
only.source§fn draw(
&self,
_state: &Tree,
renderer: &mut Renderer<B, T>,
_theme: &T,
_style: &Style,
layout: Layout<'_>,
_cursor_position: Point,
_viewport: &Rectangle
)
fn draw(
&self,
_state: &Tree,
renderer: &mut Renderer<B, T>,
_theme: &T,
_style: &Style,
layout: Layout<'_>,
_cursor_position: Point,
_viewport: &Rectangle
)
Draws the
Widget
using the associated Renderer
.source§fn operate(
&self,
_state: &mut Tree,
_layout: Layout<'_>,
_operation: &mut dyn Operation<Message>
)
fn operate(
&self,
_state: &mut Tree,
_layout: Layout<'_>,
_operation: &mut dyn Operation<Message>
)
source§fn on_event(
&mut self,
_state: &mut Tree,
_event: Event,
_layout: Layout<'_>,
_cursor_position: Point,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>
) -> Status
fn on_event(
&mut self,
_state: &mut Tree,
_event: Event,
_layout: Layout<'_>,
_cursor_position: Point,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>
) -> Status
Auto Trait Implementations§
impl<B, Theme> RefUnwindSafe for Renderer<B, Theme>where
B: RefUnwindSafe,
Theme: RefUnwindSafe,
impl<B, Theme> Send for Renderer<B, Theme>where
B: Send,
Theme: Send,
impl<B, Theme> Sync for Renderer<B, Theme>where
B: Sync,
Theme: Sync,
impl<B, Theme> Unpin for Renderer<B, Theme>where
B: Unpin,
Theme: Unpin,
impl<B, Theme> UnwindSafe for Renderer<B, Theme>where
B: UnwindSafe,
Theme: UnwindSafe,
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method Read more
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default Read more
source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more