pub struct PositiveInt { /* private fields */ }Expand description
A positive integer: 1 to i64::MAX.
The value of [ex-ostrya server] session-timeout, max-sessions, and
body-timeout. A value outside the range cannot be built.
§Examples
use ostrya_core::config::PositiveInt;
assert_eq!(PositiveInt::try_from(1).unwrap().get(), 1);
assert!(PositiveInt::try_from(0).is_err());Implementations§
Trait Implementations§
Source§impl Clone for PositiveInt
impl Clone for PositiveInt
impl Copy for PositiveInt
Source§impl Debug for PositiveInt
impl Debug for PositiveInt
impl Eq for PositiveInt
Source§impl Hash for PositiveInt
impl Hash for PositiveInt
Source§impl PartialEq for PositiveInt
impl PartialEq for PositiveInt
impl StructuralPartialEq for PositiveInt
Source§impl TryFrom<i64> for PositiveInt
impl TryFrom<i64> for PositiveInt
Source§fn try_from(value: i64) -> Result<PositiveInt, ValueError>
fn try_from(value: i64) -> Result<PositiveInt, ValueError>
§Errors
A ValueError if value is less than 1.
Source§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
Source§impl Value for PositiveInt
The text is read with decode_integer, and then checked as
PositiveInt::try_from checks it. A value above i64::MAX is not an
integer.
impl Value for PositiveInt
The text is read with decode_integer, and then checked as
PositiveInt::try_from checks it. A value above i64::MAX is not an
integer.
Auto Trait Implementations§
impl Forget for PositiveInt
impl Freeze for PositiveInt
impl Move for PositiveInt
impl RefUnwindSafe for PositiveInt
impl Send for PositiveInt
impl Sync for PositiveInt
impl Unpin for PositiveInt
impl UnsafeUnpin for PositiveInt
impl UnwindSafe for PositiveInt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more