You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
652 B
23 lines
652 B
3 years ago
|
//! General-purpose error and result types returned by public APIs of this crate.
|
||
|
|
||
|
use std::num::TryFromIntError;
|
||
|
|
||
|
/// The common result type returned by `citro3d` functions.
|
||
|
pub type Result<T> = std::result::Result<T, Error>;
|
||
|
|
||
|
/// The common error type that may be returned by `citro3d` functions.
|
||
|
#[non_exhaustive]
|
||
|
#[derive(Debug)]
|
||
|
pub enum Error {
|
||
|
/// A C3D object or context could not be initialized.
|
||
|
FailedToInitialize,
|
||
|
/// A size parameter was specified that cannot be converted to the proper type.
|
||
|
InvalidSize,
|
||
|
}
|
||
|
|
||
|
impl From<TryFromIntError> for Error {
|
||
|
fn from(_: TryFromIntError) -> Self {
|
||
|
Self::InvalidSize
|
||
|
}
|
||
|
}
|