The SKI Rust Reference implementation
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.
 
 
 

31 lines
755 B

#[derive(Debug)]
pub enum Error {
CodingError(base64::DecodeError),
InvalidLength(usize),
InvalidSchemeLength(u8),
BadScheme(String),
BadEncoding(std::str::Utf8Error),
SchemeTooLong(std::num::TryFromIntError),
MissingArgument(String),
BadNonce([u8; 32]),
}
impl From<base64::DecodeError> for Error {
fn from(err: base64::DecodeError) -> Error {
Error::CodingError(err)
}
}
impl From<std::str::Utf8Error> for Error {
fn from(err: std::str::Utf8Error) -> Error {
Error::BadEncoding(err)
}
}
impl From<std::num::TryFromIntError> for Error {
fn from(err: std::num::TryFromIntError) -> Error {
Error::SchemeTooLong(err)
}
}
pub type Result<T> = std::result::Result<T, Error>;