pub struct OpticError {
pub kind: OpticErrorKind,
pub msg: String,
}Expand description
The primary error type for the Optic engine.
All fallible functions in the engine return OpticResult<T>.
Errors propagate upward via ? and can be handled generically
by inspecting kind.
use optic_core::*;
fn load_shader(path: &str) -> OpticResult<()> {
Err(OpticError::new(OpticErrorKind::Shader, "compile failed"))
}Fields§
§kind: OpticErrorKind§msg: StringImplementations§
Trait Implementations§
Source§impl Clone for OpticError
impl Clone for OpticError
Source§fn clone(&self) -> OpticError
fn clone(&self) -> OpticError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpticError
impl Debug for OpticError
Auto Trait Implementations§
impl Freeze for OpticError
impl RefUnwindSafe for OpticError
impl Send for OpticError
impl Sync for OpticError
impl Unpin for OpticError
impl UnsafeUnpin for OpticError
impl UnwindSafe for OpticError
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