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
sourceimpl<B, T> Renderer for Renderer<B, T>where
B: Backend,
impl<B, T> Renderer for Renderer<B, T>where
B: Backend,
sourcefn 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
sourcefn 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
sourcefn 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.sourcefn 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
.sourceimpl<B, T> Renderer for Renderer<B, T>where
B: Backend + Text,
impl<B, T> Renderer for Renderer<B, T>where
B: Backend + Text,
sourceconst CHECKMARK_ICON: char = B::CHECKMARK_ICON
const CHECKMARK_ICON: char = B::CHECKMARK_ICON
sourceconst ARROW_DOWN_ICON: char = B::ARROW_DOWN_ICON
const ARROW_DOWN_ICON: char = B::ARROW_DOWN_ICON
sourcefn default_size(&self) -> u16
fn default_size(&self) -> u16
Returns the default size of
Text
.sourcefn 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
sourceimpl<B, T> Renderer for Renderer<B, T>where
B: Backend + Image,
impl<B, T> Renderer for Renderer<B, T>where
B: Backend + Image,
sourceimpl<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.sourcefn 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
sourcefn 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
sourcefn 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
.sourcefn children(&self) -> Vec<Tree, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn children(&self) -> Vec<Tree, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
sourceimpl<'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.sourcefn 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
.sourcefn children(&self) -> Vec<Tree, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn children(&self) -> Vec<Tree, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
sourcefn 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>
)
sourcefn 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
sourceimpl<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>,
sourcefn 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
sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
sourceimpl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
sourcefn 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
sourceimpl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
sourcefn 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