Struct confitul::BadSizeError
source · Fields§
§field: String§value: usize§min: usize§max: usizeImplementations§
source§impl BadSizeError
impl BadSizeError
sourcepub fn new(field: &str, value: usize, min: usize, max: usize) -> BadSizeError
pub fn new(field: &str, value: usize, min: usize, max: usize) -> BadSizeError
Examples found in repository?
src/config_check.rs (lines 48-50)
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
pub fn check(
field: &str,
value: usize,
min: usize,
max: usize,
) -> Result<(), ConfigCheckError> {
if value < min {
return Err(ConfigCheckError::BadSize(BadSizeError::new(
field, value, min, max,
)));
}
if value > max {
return Err(ConfigCheckError::BadSize(BadSizeError::new(
field, value, min, max,
)));
}
Ok(())
}Trait Implementations§
source§impl Debug for BadSizeError
impl Debug for BadSizeError
source§impl Display for BadSizeError
impl Display for BadSizeError
source§impl PartialEq<BadSizeError> for BadSizeError
impl PartialEq<BadSizeError> for BadSizeError
source§fn eq(&self, other: &BadSizeError) -> bool
fn eq(&self, other: &BadSizeError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.