Write docs for iced and iced_native
This commit is contained in:
parent
ba56a561b2
commit
a7dba612f0
30 changed files with 877 additions and 214 deletions
|
|
@ -32,9 +32,21 @@ pub use windowed::{Target, Windowed};
|
|||
|
||||
use crate::{layout, Element};
|
||||
|
||||
/// A component that can take the state of a user interface and produce an
|
||||
/// output for its users.
|
||||
pub trait Renderer: Sized {
|
||||
/// The type of output of the [`Renderer`].
|
||||
///
|
||||
/// If you are implementing a graphical renderer, your output will most
|
||||
/// likely be a tree of visual primitives.
|
||||
///
|
||||
/// [`Renderer`]: trait.Renderer.html
|
||||
type Output;
|
||||
|
||||
/// Lays out the elements of a user interface.
|
||||
///
|
||||
/// You should override this if you need to perform any operations before or
|
||||
/// after layouting. For instance, trimming the measurements cache.
|
||||
fn layout<'a, Message>(
|
||||
&mut self,
|
||||
element: &Element<'a, Message, Self>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue