Struct coap_lite::block_handler::BlockHandlerConfig

source ·
pub struct BlockHandlerConfig {
    pub max_total_message_size: usize,
    pub cache_expiry_duration: Duration,
}
Expand description

The configuration for BlockHandler.

Fields§

§max_total_message_size: usize

Total framed message size to offer to the peer (packet size minus transport overhead). In an ideal world this would be computed based on the endpoint MTU or even part of a more structured Endpoint API but we’re pretty far off from that today. Just make it configurable then.

Note this is not the suggested block size as that is referring only to the payload body. Because we have dynamic overhead for the CoAP message itself (for example if we add more options), we need to dynamically tune this to meet the physical requirements of the link rather than just some arbitrary limiting of the payload block size.

§cache_expiry_duration: Duration

Length of time without interaction for cached responses to live (bumped each time the client requests some portion of the response).

Trait Implementations§

source§

impl Default for BlockHandlerConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.