aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2024-06-27 20:22:16 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2024-06-27 20:22:16 +0100
commit1f0103cbecc6a4dfe3f34fb6441d4d491b385142 (patch)
tree6551f950332e5c913f33720e92c88cdf67ed5832 /src/error.rs
parentc08b4504ab326203b2c11abe566e518b6466613a (diff)
downloadpeanuts-1f0103cbecc6a4dfe3f34fb6441d4d491b385142.tar.gz
peanuts-1f0103cbecc6a4dfe3f34fb6441d4d491b385142.tar.bz2
peanuts-1f0103cbecc6a4dfe3f34fb6441d4d491b385142.zip
WIP: stream parsing
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index 12fcaf2..78508ae 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1 +1,19 @@
-pub enum Error {}
+use std::str::Utf8Error;
+
+pub enum Error {
+ ReadError(std::io::Error),
+ Utf8Error(Utf8Error),
+ ParseError(String),
+}
+
+impl From<std::io::Error> for Error {
+ fn from(e: std::io::Error) -> Self {
+ Self::ReadError(e)
+ }
+}
+
+impl From<Utf8Error> for Error {
+ fn from(e: Utf8Error) -> Self {
+ Self::Utf8Error(e)
+ }
+}