Struct exonum::encoding::CheckedOffset
[−]
[src]
pub struct CheckedOffset { /* fields omitted */ }
CheckedOffset
is a type that take control over overflow,
so you can't panic without unwrap
,
and work with this value without overflow checks.
Methods
impl CheckedOffset
[src]
pub fn new(offset: Offset) -> CheckedOffset
[src]
create checked value
pub fn unchecked_offset(self) -> Offset
[src]
return unchecked offset
Trait Implementations
impl Debug for CheckedOffset
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for CheckedOffset
[src]
fn clone(&self) -> CheckedOffset
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for CheckedOffset
[src]
impl Eq for CheckedOffset
[src]
impl PartialEq for CheckedOffset
[src]
fn eq(&self, __arg_0: &CheckedOffset) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &CheckedOffset) -> bool
[src]
This method tests for !=
.
impl Ord for CheckedOffset
[src]
fn cmp(&self, __arg_0: &CheckedOffset) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for CheckedOffset
[src]
fn partial_cmp(&self, __arg_0: &CheckedOffset) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &CheckedOffset) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &CheckedOffset) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &CheckedOffset) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &CheckedOffset) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Add<CheckedOffset> for CheckedOffset
[src]
type Output = Result<CheckedOffset, Error>
The resulting type after applying the +
operator.
fn add(self, rhs: CheckedOffset) -> Self::Output
[src]
Performs the +
operation.
impl Add<Offset> for CheckedOffset
[src]
type Output = Result<CheckedOffset, Error>
The resulting type after applying the +
operator.
fn add(self, rhs: Offset) -> Self::Output
[src]
Performs the +
operation.
impl Sub<CheckedOffset> for CheckedOffset
[src]
type Output = Result<CheckedOffset, Error>
The resulting type after applying the -
operator.
fn sub(self, rhs: CheckedOffset) -> Self::Output
[src]
Performs the -
operation.
impl Sub<Offset> for CheckedOffset
[src]
type Output = Result<CheckedOffset, Error>
The resulting type after applying the -
operator.
fn sub(self, rhs: Offset) -> Self::Output
[src]
Performs the -
operation.
impl Mul<CheckedOffset> for CheckedOffset
[src]
type Output = Result<CheckedOffset, Error>
The resulting type after applying the *
operator.
fn mul(self, rhs: CheckedOffset) -> Self::Output
[src]
Performs the *
operation.
impl Mul<Offset> for CheckedOffset
[src]
type Output = Result<CheckedOffset, Error>
The resulting type after applying the *
operator.
fn mul(self, rhs: Offset) -> Self::Output
[src]
Performs the *
operation.
impl Div<CheckedOffset> for CheckedOffset
[src]
type Output = Result<CheckedOffset, Error>
The resulting type after applying the /
operator.
fn div(self, rhs: CheckedOffset) -> Self::Output
[src]
Performs the /
operation.
impl Div<Offset> for CheckedOffset
[src]
type Output = Result<CheckedOffset, Error>
The resulting type after applying the /
operator.
fn div(self, rhs: Offset) -> Self::Output
[src]
Performs the /
operation.
impl From<Offset> for CheckedOffset
[src]
fn from(offset: Offset) -> CheckedOffset
[src]
Performs the conversion.