[−][src]Enum bytecodec::ByteCount
Number of bytes of interest.
Variants
Finite(u64)
Methods
impl ByteCount
[src]
pub fn is_finite(&self) -> bool
[src]
Returns true
if this is ByteCount::Finite(_)
, otherwise false
.
pub fn is_infinite(&self) -> bool
[src]
Returns true
if this is ByteCount::Infinite
, otherwise false
.
pub fn is_unknow(&self) -> bool
[src]
Returns true
if this is ByteCount::Unknown
, otherwise false
.
pub fn to_u64(&self) -> Option<u64>
[src]
Tries to convert this ByteCount
to an u64
value.
If it is not a ByteCount::Finite(_)
,None
will be returned.
pub fn add_for_decoding(self, other: Self) -> Self
[src]
Adds two ByteCount
instances for decoding (i.e., Decode::requiring_bytes
method).
Rule
Finite(a) + Finite(b) = Finite(a + b)
Infinite + _ = Infinite
_ + Infinite = Infinite
Unknown + Unknown = Unknown
Finite(0) + Unknown = Unknown
Unknown + Finite(0) = Unknown
Finite(a) + Unknown = Finite(a)
Unknown + Finite(b) = Finite(b)
pub fn add_for_encoding(self, other: Self) -> Self
[src]
Adds two ByteCount
instances for encoding (i.e., Encode::requiring_bytes
method).
Rule
Finite(a) + Finite(b) = Finite(a + b)
Infinite + _ = Infinite
_ + Infinite = Infinite
Unknown + _ = Unknown
_ + Unknown = Unknown
Trait Implementations
impl Eq for ByteCount
[src]
impl Default for ByteCount
[src]
impl Clone for ByteCount
[src]
impl PartialOrd<ByteCount> for ByteCount
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<ByteCount> for ByteCount
[src]
impl Copy for ByteCount
[src]
impl Hash for ByteCount
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Debug for ByteCount
[src]
Auto Trait Implementations
impl Send for ByteCount
impl Unpin for ByteCount
impl Sync for ByteCount
impl UnwindSafe for ByteCount
impl RefUnwindSafe for ByteCount
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,