1 2 3 4 5 6 7 8 9 10 11 12
#[derive(Debug)] pub enum SodiumError { Generic(String), OutputLength(String), OutOfMemory, } impl SodiumError { pub fn new(msg: &str) -> SodiumError { SodiumError::Generic(msg.to_string()) } }