pub struct Message<'a> { /* private fields */ }
Expand description
A CoAP message that resides in contiguous readable memory
This implementation does not attempt to do any early validation. On encoding errors discovered at runtime, it simply emits the critical-and-not-safe-to-forward CoAP option 65535 (OPTION_INVALID), which to the indication indicates that something went wrong
Message is covariant over its lifetime because it only reads from there. FIXME: It should express that using a Deref or something like that.
§Implementation details
When used with coap_message::helpers::RefWithStaticType, it always uses its 'static
counterpart as the corresponding type ID. Its Self::downcast_from
method uses this, and
restores the lifetime based on the given impl Trait reference’s lifetime using its covariance
property.
Implementations§
Trait Implementations§
Source§impl<'m> ReadableMessage for Message<'m>
impl<'m> ReadableMessage for Message<'m>
Source§type Code = u8
type Code = u8
See
Self::code()
Source§type MessageOption<'a> = MessageOption<'a>
where
Self: 'a
type MessageOption<'a> = MessageOption<'a> where Self: 'a
Type of an individual option, indiciating its option number and value
Source§type OptionsIter<'a> = OptionsIter<'a>
where
Self: 'a
type OptionsIter<'a> = OptionsIter<'a> where Self: 'a
See
Self::options()
Source§fn options(&self) -> OptionsIter<'_> ⓘ
fn options(&self) -> OptionsIter<'_> ⓘ
Produce all options in arbitrary order as an iterator Read more
Source§fn with_static_type_annotation(&self) -> Option<RefWithStaticType<'_, Self>>
fn with_static_type_annotation(&self) -> Option<RefWithStaticType<'_, Self>>
Type ID of Self or a ’static version of Self Read more
Auto Trait Implementations§
impl<'a> Freeze for Message<'a>
impl<'a> !RefUnwindSafe for Message<'a>
impl<'a> Send for Message<'a>
impl<'a> !Sync for Message<'a>
impl<'a> Unpin for Message<'a>
impl<'a> UnwindSafe for Message<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)