From b4e12fd1165b5e3960a1294dadec45eb40893b37 Mon Sep 17 00:00:00 2001 From: daniloaz Date: Sun, 24 Mar 2024 21:47:33 +0100 Subject: Unstable commit, won't compile. --- src/lib.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index c7ea164..3ae6463 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,6 +11,27 @@ pub mod lightstreamer_client; 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 -- cgit v1.2.3