Improve return type for insert function
This commit is contained in:
@ -22,12 +22,24 @@ pub struct Texture {
|
||||
}
|
||||
|
||||
pub enum ReplaceTextureStatus {
|
||||
// Done.
|
||||
/// Done.
|
||||
Ok,
|
||||
|
||||
// Call Again With Texture Binary
|
||||
/// Call Again With Texture Binary
|
||||
NeedTextureData(Sha256),
|
||||
|
||||
// Name or id already in use
|
||||
Conflict,
|
||||
}
|
||||
|
||||
pub type ProtocolResult<T> = Result<T, ProtocolError>;
|
||||
pub enum ProtocolError {
|
||||
BadRequest(String),
|
||||
FileNotFound(String),
|
||||
Conflict(String),
|
||||
InternalServerError(std::io::Error),
|
||||
NotImplemented,
|
||||
}
|
||||
|
||||
impl From<io::Error> for ProtocolError {
|
||||
fn from(err: io::Error) -> Self {
|
||||
ProtocolError::InternalServerError(err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user