pub struct RenderFailure {
pub message: String,
}Expand description
Inserted the first time Backend::acquire returns
AcquireError::Fatal — the render loop has permanently stopped
producing frames (a lost device, a destroyed surface, anything the
backend itself judged unrecoverable). Once this exists, begin_frame
stops calling acquire at all, so the same fatal condition isn’t
re-triggered and re-logged every tick forever.
The framework deliberately does not panic or exit on your behalf here — a hard crash isn’t always the right response, and only your application knows whether the right move is an error screen, a full backend re-init, or something else. Check for it explicitly wherever that decision belongs:
fn on_render_death(failure: Res<RenderFailure>) -> Option<()> {
eprintln!("rendering has permanently stopped: {}", failure.message);
Some(()) // .once() — react exactly once, not every tick thereafter
}
app.add_system(SystemStage::PostRender, on_render_death.once());RenderPlugin declares this as provided, so
a system with a hard Res<RenderFailure> requirement (as in the example
above) waits quietly for it rather than panicking at startup over a
resource that, in the common case where rendering never fails, is
correctly never going to appear.
Fields§
§message: StringAuto Trait Implementations§
impl Freeze for RenderFailure
impl RefUnwindSafe for RenderFailure
impl Send for RenderFailure
impl Sync for RenderFailure
impl Unpin for RenderFailure
impl UnsafeUnpin for RenderFailure
impl UnwindSafe for RenderFailure
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> Component for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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