opengl_graphics/error.rs
1//! Errors
2
3use std::fmt;
4
5/// An enum to represent various possible run-time errors that may occur.
6#[derive(Debug)]
7pub enum Error {
8 /// An error happened with I/O.
9 IoError(::std::io::Error),
10}
11
12impl fmt::Display for Error {
13 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
14 fmt::Debug::fmt(self, f)
15 }
16}
17
18impl From<::std::io::Error> for Error {
19 fn from(err: ::std::io::Error) -> Error {
20 Error::IoError(err)
21 }
22}