Chunking the blog posts for the stream.

This commit is contained in:
Tom Alexander
2023-12-17 16:57:37 -05:00
parent fdf84e3d0b
commit c3482cf1e4
6 changed files with 84 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ use std::string::FromUtf8Error;
#[derive(Debug)]
pub(crate) enum CustomError {
Static(&'static str),
String(String),
IO(std::io::Error),
TomlSerialize(toml::ser::Error),
TomlDeserialize(toml::de::Error),
@@ -29,6 +30,12 @@ impl From<&'static str> for CustomError {
}
}
impl From<String> for CustomError {
fn from(value: String) -> Self {
CustomError::String(value)
}
}
impl From<toml::ser::Error> for CustomError {
fn from(value: toml::ser::Error) -> Self {
CustomError::TomlSerialize(value)