pub struct Renderer<W: CustomWidget> { /* private fields */ }Expand description
A widget’s renders on the current platform: native, drawn or composed.
The first one present is used: native, then drawn, then composed. The
others stay available (for headless tests, .drawn(), .composed()).
Implementations§
Source§impl<W: CustomWidget> Renderer<W>
impl<W: CustomWidget> Renderer<W>
Sourcepub fn native(render: Opaque) -> Renderer<W>
pub fn native(render: Opaque) -> Renderer<W>
For backend crates: a native render that is the platform’s own control, in whatever form the backend understands. Apps use the backend’s constructor instead.
Sourcepub fn ad_hoc(render: Opaque) -> Renderer<W>
pub fn ad_hoc(render: Opaque) -> Renderer<W>
For backend crates: a render built ad hoc from the platform’s widgets,
where the platform has no such control. It’s rendered like a native
one, but is_native says no.
Sourcepub fn with_drawn(self) -> Renderer<W>where
W: Drawn,
pub fn with_drawn(self) -> Renderer<W>where
W: Drawn,
Keeps the drawn render too: headless tests lay the widget out with
it, and Custom::drawn can pick it.
Sourcepub fn composed<V: View>(
compose: impl Fn(Composed<W>) -> V + 'static,
) -> Renderer<W>
pub fn composed<V: View>( compose: impl Fn(Composed<W>) -> V + 'static, ) -> Renderer<W>
Composes the widget from built-in widgets: the tier for widgets the canvas can’t draw.
Auto Trait Implementations§
impl<W> !RefUnwindSafe for Renderer<W>
impl<W> !Send for Renderer<W>
impl<W> !Sync for Renderer<W>
impl<W> !UnwindSafe for Renderer<W>
impl<W> Forget for Renderer<W>
impl<W> Freeze for Renderer<W>
impl<W> Move for Renderer<W>
impl<W> Unpin for Renderer<W>
impl<W> UnsafeUnpin for Renderer<W>where
&'static str: UnsafeUnpin,
*const RcInner<dyn Any> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Any>>: UnsafeUnpin,
*const RcInner<dyn Fn(Composed<W>) -> AnyView> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(Composed<W>) -> AnyView>>: UnsafeUnpin,
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