pub struct ViewRenderer(/* private fields */);Expand description
Type-erased view renderer stored in Environment.
This wrapper allows storing the renderer in the Environment without exposing the concrete implementation type.
Implementations§
Source§impl ViewRenderer
impl ViewRenderer
Sourcepub fn new<T: CustomViewRenderer>(renderer: T) -> Self
pub fn new<T: CustomViewRenderer>(renderer: T) -> Self
Create a new view renderer from a custom implementation.
Sourcepub async fn render(&self, view: AnyView, size: RenderSize) -> RenderResult
pub async fn render(&self, view: AnyView, size: RenderSize) -> RenderResult
Render a view to RGBA pixel data.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ViewRenderer
impl !Send for ViewRenderer
impl !Sync for ViewRenderer
impl !UnwindSafe for ViewRenderer
impl Freeze for ViewRenderer
impl Unpin for ViewRenderer
impl UnsafeUnpin for ViewRenderer
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