pub struct SafeRenderer;Expand description
Safe renderer that isolates plugin panics.
Use this to render plugin zones instead of calling plugin.render()
directly. If a plugin panics, the zone shows a crash message and
the rest of the application continues normally.
Implementations§
Source§impl SafeRenderer
impl SafeRenderer
Sourcepub fn render(
plugin: &Arc<dyn ZonePlugin>,
zone_id: ZoneId,
ctx: &RenderContext,
area: Rect,
buf: &mut Buffer,
) -> bool
pub fn render( plugin: &Arc<dyn ZonePlugin>, zone_id: ZoneId, ctx: &RenderContext, area: Rect, buf: &mut Buffer, ) -> bool
Renders a plugin’s zone with panic isolation.
Returns true if the plugin rendered successfully, false if
it panicked or returned false (nothing to show).
Auto Trait Implementations§
impl Freeze for SafeRenderer
impl RefUnwindSafe for SafeRenderer
impl Send for SafeRenderer
impl Sync for SafeRenderer
impl Unpin for SafeRenderer
impl UnsafeUnpin for SafeRenderer
impl UnwindSafe for SafeRenderer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more