Skip to main content

s2_common/types/
mod.rs

1pub mod access;
2pub mod basin;
3pub mod config;
4pub mod location;
5pub mod metrics;
6pub mod resources;
7pub mod stream;
8mod strings;
9
10#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
11#[error("{0}")]
12pub struct ValidationError(pub String);
13
14impl From<String> for ValidationError {
15    fn from(value: String) -> Self {
16        ValidationError(value)
17    }
18}
19
20impl From<&str> for ValidationError {
21    fn from(value: &str) -> Self {
22        ValidationError(value.to_owned())
23    }
24}
25
26impl From<crate::record::FencingTokenTooLongError> for ValidationError {
27    fn from(e: crate::record::FencingTokenTooLongError) -> Self {
28        ValidationError(e.to_string())
29    }
30}
31
32impl From<resources::StartAfterLessThanPrefixError> for ValidationError {
33    fn from(e: resources::StartAfterLessThanPrefixError) -> Self {
34        ValidationError(e.to_string())
35    }
36}