HandleError

Trait HandleError 

Source
pub trait HandleError<Out = ()>: Send + 'static {
    // Required methods
    fn handle_error_with(
        self,
        error_handler: fn(BevyError, ErrorContext),
    ) -> impl Command;
    fn handle_error(self) -> impl Command;
    fn ignore_error(self) -> impl Command;
}
Expand description

Takes a Command that potentially returns a Result and uses a given error handler function to convert it into a Command that internally handles an error if it occurs and returns ().

Required Methods§

Source

fn handle_error_with( self, error_handler: fn(BevyError, ErrorContext), ) -> impl Command

Takes a Command that returns a Result and uses a given error handler function to convert it into a Command that internally handles an error if it occurs and returns ().

Source

fn handle_error(self) -> impl Command

Takes a Command that returns a Result and uses the default error handler function to convert it into a Command that internally handles an error if it occurs and returns ().

Source

fn ignore_error(self) -> impl Command

Takes a Command that returns a Result and ignores any error that occurs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C> HandleError for C
where C: Command,

Source§

impl<C> HandleError<<fn() -> ! as FnRet>::Output> for C
where C: Command<<fn() -> ! as FnRet>::Output>,

Source§

impl<C, T, E> HandleError<Result<T, E>> for C
where C: Command<Result<T, E>>, E: Into<BevyError>,