pub enum Error {
InvalidEnum,
InvalidValue,
InvalidOperation,
Unavailable,
StackOverflow,
StackUnderflow,
OutOfMemory,
InvalidFramebufferOperation,
ShaderError(String),
}Expand description
An error that may be returned from an OpenGL operation.
This is normally retrieved by calling glGetError, which is mapped to
Error::last_error.
Variants§
InvalidEnum
InvalidValue
InvalidOperation
StackOverflow
StackUnderflow
OutOfMemory
InvalidFramebufferOperation
ShaderError(String)
Implementations§
source§impl Error
impl Error
sourcepub fn last_error() -> Option<Self>
pub fn last_error() -> Option<Self>
Returns the last error that occurred by calling glGetError.
sourcepub fn from_gl_status(code: GLuint) -> Option<Self>
pub fn from_gl_status(code: GLuint) -> Option<Self>
Creates a new error from a GLEW error code.
§Parameters
code- The error code to create the error from
sourcepub unsafe fn from_gl_status_unchecked(code: GLuint) -> Self
pub unsafe fn from_gl_status_unchecked(code: GLuint) -> Self
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)