pub trait BoundedString {
const TYPE_DESCRIPTION: &'static str;
const MIN_LENGTH: Option<usize> = None;
const MAX_LENGTH: Option<usize> = None;
const DEFAULT: Option<&'static str> = None;
const PATTERN: Option<&'static str> = None;
// Required methods
fn get_value(&self) -> &str;
fn new(value: String) -> Result<Self, BoundedStringError>
where Self: Sized;
// Provided method
fn validate(value: &str) -> Result<(), BoundedStringError> { ... }
}Required Associated Constants§
const TYPE_DESCRIPTION: &'static str
Provided Associated Constants§
const MIN_LENGTH: Option<usize> = None
const MAX_LENGTH: Option<usize> = None
const DEFAULT: Option<&'static str> = None
const PATTERN: Option<&'static str> = None
Required Methods§
fn get_value(&self) -> &str
fn new(value: String) -> Result<Self, BoundedStringError>where
Self: Sized,
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".