use super::Event;
use snafu::Snafu;
pub trait EventBuilder
where
Self: Clone + Sized + From<Event> + Default,
{
fn new() -> Self;
fn build(self) -> Result<Event, Error>;
}
#[derive(Debug, Snafu, Clone)]
pub enum Error {
#[snafu(display("Missing required attribute {}", attribute_name))]
MissingRequiredAttribute { attribute_name: &'static str },
#[snafu(display(
"Error while setting attribute '{}' with timestamp type: {}",
attribute_name,
source
))]
ParseTimeError {
attribute_name: &'static str,
source: chrono::ParseError,
},
#[snafu(display(
"Error while setting attribute '{}' with uri type: {}",
attribute_name,
source
))]
ParseUrlError {
attribute_name: &'static str,
source: url::ParseError,
},
#[snafu(display(
"Invalid value setting attribute '{}' with uriref type",
attribute_name,
))]
InvalidUriRefError { attribute_name: &'static str },
}