[−][src]Struct async_coap::message::VecMessageEncoder
A class for writing stand-alone messages to a heap-allocated Vec
.
Methods
impl VecMessageEncoder
[src]
ⓘImportant traits for VecMessageEncoderpub fn new() -> VecMessageEncoder
[src]
Creates a new VecMessageEncoder
instance.
ⓘImportant traits for VecMessageEncoderpub fn with_payload_capacity(capacity: usize) -> VecMessageEncoder
[src]
Creates a new VecMessageEncoder
instance with a specific capacity.
pub fn as_bytes(&self) -> &[u8]
[src]
Returns a byte slice containing the encoded message.
pub fn msg_token(&self) -> MsgToken
[src]
Returns the token set for this message.
Trait Implementations
impl MessageWrite for VecMessageEncoder
[src]
fn set_msg_type(&mut self, tt: MsgType)
[src]
fn set_msg_id(&mut self, msg_id: u16)
[src]
fn set_msg_code(&mut self, code: MsgCode)
[src]
fn set_msg_token(&mut self, token: MsgToken)
[src]
fn append_payload_bytes(&mut self, body: &[u8]) -> Result<(), Error>
[src]
fn clear(&mut self)
[src]
fn append_payload_string(&mut self, body: &str) -> Result<(), Error>
[src]
Appends bytes from the UTF8 representation of the given string slice body
to the payload of the message. This method should only be called after the token and all options have been set. This method may be called multiple times, each time appending data to the payload. Read more
fn append_payload_u8(&mut self, b: u8) -> Result<(), Error>
[src]
Appends a single byte to the payload of the message. This method should only be called after the token and all options have been set. This method may be called multiple times, each time appending data to the payload. Read more
fn append_payload_char(&mut self, c: char) -> Result<(), Error>
[src]
Appends the UTF8 representation for a single unicode character to the payload of the message. This method should only be called after the token and all options have been set. This method may be called multiple times, each time appending data to the payload. Read more
impl OptionInsert for VecMessageEncoder
[src]
fn insert_option_with_bytes(
&mut self,
key: OptionNumber,
value: &[u8]
) -> Result<(), Error>
[src]
&mut self,
key: OptionNumber,
value: &[u8]
) -> Result<(), Error>
fn insert_option_empty(&mut self, key: OptionNumber) -> Result<(), Error>
[src]
Inserts an option into the message with no value. Calling this method with out-of-order keys will incur a significant performance penalty. Read more
fn insert_option_with_str(
&mut self,
key: OptionNumber,
value: &str
) -> Result<(), Error>
[src]
&mut self,
key: OptionNumber,
value: &str
) -> Result<(), Error>
Inserts an option into the message with a string value. Calling this method with out-of-order keys will incur a significant performance penalty. Read more
fn insert_option_with_u32(
&mut self,
key: OptionNumber,
value: u32
) -> Result<(), Error>
[src]
&mut self,
key: OptionNumber,
value: u32
) -> Result<(), Error>
Inserts an option into the message with an integer value. Calling this method with out-of-order keys will incur a significant performance penalty. Read more
impl Default for VecMessageEncoder
[src]
impl From<VecMessageEncoder> for Vec<u8>
[src]
fn from(x: VecMessageEncoder) -> Self
[src]
impl From<VecMessageEncoder> for OwnedImmutableMessage
[src]
fn from(x: VecMessageEncoder) -> Self
[src]
impl Deref for VecMessageEncoder
[src]
impl Display for VecMessageEncoder
[src]
impl Debug for VecMessageEncoder
[src]
impl Write for VecMessageEncoder
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
[src]
fn flush(&mut self) -> Result<(), Error>
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
Like write
, except that it writes from a slice of buffers. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Creates a "by reference" adaptor for this instance of Write
. Read more
Auto Trait Implementations
impl Send for VecMessageEncoder
impl Unpin for VecMessageEncoder
impl Sync for VecMessageEncoder
impl UnwindSafe for VecMessageEncoder
impl RefUnwindSafe for VecMessageEncoder
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,