We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a10323 commit f630e25Copy full SHA for f630e25
src/sdl2/sdl.rs
@@ -1,3 +1,4 @@
1
+use std::error;
2
use std::ffi::{CStr, CString, NulError};
3
use std::fmt;
4
use std::rc::Rc;
@@ -28,6 +29,20 @@ impl fmt::Display for Error {
28
29
}
30
31
32
+impl error::Error for Error {
33
+ fn description(&self) -> &str {
34
+ use self::Error::*;
35
+
36
+ match *self {
37
+ NoMemError => "out of memory",
38
+ ReadError => "error reading from datastream",
39
+ WriteError => "error writing to datastream",
40
+ SeekError => "error seeking in datastream",
41
+ UnsupportedError => "unknown SDL error"
42
+ }
43
44
+}
45
46
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT};
47
/// Only one Sdl context can be alive at a time.
48
/// Set to false by default (not alive).
0 commit comments