diff options
author | 2024-03-24 21:47:33 +0100 | |
---|---|---|
committer | 2024-03-24 21:47:33 +0100 | |
commit | b4e12fd1165b5e3960a1294dadec45eb40893b37 (patch) | |
tree | 214908f3aaf1bea984adfdce4d9b755ba71be670 /src/lib.rs | |
parent | 7e1eb27a06e5545b3d1b77b5998dc0463df27d70 (diff) |
Unstable commit, won't compile.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -12,6 +12,27 @@ pub mod proxy; pub mod subscription; #[derive(Debug)] +pub struct IllegalArgumentException(String); + +impl IllegalArgumentException { + pub fn new(msg: &str) -> IllegalArgumentException { + IllegalArgumentException(msg.to_string()) + } +} + +impl fmt::Display for IllegalArgumentException { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", self.0) + } +} + +impl Error for IllegalArgumentException { + fn description(&self) -> &str { + &self.0 + } +} + +#[derive(Debug)] pub struct IllegalStateException { details: String } |