[−][src]Struct async_coap::BlockInfo
Type for interpreting block1
and block2
option values.
Methods
impl BlockInfo
[src]
pub const NUM_MAX: u32
[src]
Maximum legal value for num
.
pub const SZX_MAX: u8
[src]
Maximum legal value for szx
.
pub fn new(num: u32, m: bool, szx: u8) -> Option<BlockInfo>
[src]
Constructs a new BlockInfo
from the number, more flag, and size exponent.
pub fn num(&self) -> u32
[src]
Block number value.
pub fn more_flag(&self) -> bool
[src]
More flag value. If set, there are more blocks to follow.
pub fn szx(&self) -> u8
[src]
Block size exponent field value.
pub fn offset(&self) -> usize
[src]
The offset (in bytes) that this block starts at.
pub fn len(&self) -> usize
[src]
The length of this block, in bytes.
pub fn is_max_block(&self) -> bool
[src]
Determines if calling BlockInfo::next
will yield the next block or not.
If this method returns true, calling BlockInfo::next
will fail.
pub fn is_invalid(&self) -> bool
[src]
Checks the validity of the contained value.
pub fn valid(self) -> Option<BlockInfo>
[src]
Checks the contained value for validity and, if valid, returns it in an Option
.
pub fn next(&self) -> Option<BlockInfo>
[src]
Calculates what the next block will be, if any.
pub fn smaller(&self) -> Option<BlockInfo>
[src]
Calculates a smaller block size that maintains this block's offset.
pub fn with_more_flag(&self) -> BlockInfo
[src]
Returns this BlockInfo
's value with the more flag set.
pub fn without_more_flag(&self) -> BlockInfo
[src]
Returns this BlockInfo
's value without the more flag set.
Trait Implementations
impl Clone for BlockInfo
[src]
fn clone(&self) -> BlockInfo
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for BlockInfo
[src]
impl Ord for BlockInfo
[src]
fn cmp(&self, other: &BlockInfo) -> Ordering
[src]
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
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl PartialOrd<BlockInfo> for BlockInfo
[src]
fn partial_cmp(&self, other: &BlockInfo) -> Option<Ordering>
[src]
fn lt(&self, other: &BlockInfo) -> bool
[src]
fn le(&self, other: &BlockInfo) -> bool
[src]
fn gt(&self, other: &BlockInfo) -> bool
[src]
fn ge(&self, other: &BlockInfo) -> bool
[src]
impl From<u32> for BlockInfo
[src]
impl Copy for BlockInfo
[src]
impl Eq for BlockInfo
[src]
impl PartialEq<BlockInfo> for BlockInfo
[src]
impl Hash for BlockInfo
[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,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for BlockInfo
[src]
impl Debug for BlockInfo
[src]
Auto Trait Implementations
impl Unpin for BlockInfo
impl Sync for BlockInfo
impl Send for BlockInfo
impl UnwindSafe for BlockInfo
impl RefUnwindSafe for BlockInfo
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,