Struct coap_lite::CoapRequest
source · [−]pub struct CoapRequest<Endpoint> {
pub message: Packet,
pub response: Option<CoapResponse>,
pub source: Option<Endpoint>,
}Expand description
The CoAP request.
Fields
message: Packetresponse: Option<CoapResponse>source: Option<Endpoint>Implementations
sourceimpl<Endpoint> CoapRequest<Endpoint>
impl<Endpoint> CoapRequest<Endpoint>
sourcepub fn new() -> CoapRequest<Endpoint>
pub fn new() -> CoapRequest<Endpoint>
Creates a new request.
sourcepub fn from_packet(packet: Packet, source: Endpoint) -> CoapRequest<Endpoint>
pub fn from_packet(packet: Packet, source: Endpoint) -> CoapRequest<Endpoint>
Creates a request from a packet.
sourcepub fn set_method(&mut self, method: Method)
pub fn set_method(&mut self, method: Method)
Sets the method.
sourcepub fn get_method(&self) -> &Method
pub fn get_method(&self) -> &Method
Returns the method.
sourcepub fn get_observe_flag(&self) -> Option<Result<ObserveOption, InvalidObserve>>
pub fn get_observe_flag(&self) -> Option<Result<ObserveOption, InvalidObserve>>
Returns the flag in the Observe option or InvalidObserve if the flag was provided but not understood.
sourcepub fn set_observe_flag(&mut self, flag: ObserveOption)
pub fn set_observe_flag(&mut self, flag: ObserveOption)
Sets the flag in the Observe option.
Trait Implementations
sourceimpl<Endpoint: Clone> Clone for CoapRequest<Endpoint>
impl<Endpoint: Clone> Clone for CoapRequest<Endpoint>
sourcefn clone(&self) -> CoapRequest<Endpoint>
fn clone(&self) -> CoapRequest<Endpoint>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<Endpoint: Debug> Debug for CoapRequest<Endpoint>
impl<Endpoint: Debug> Debug for CoapRequest<Endpoint>
Auto Trait Implementations
impl<Endpoint> RefUnwindSafe for CoapRequest<Endpoint> where
Endpoint: RefUnwindSafe,
impl<Endpoint> Send for CoapRequest<Endpoint> where
Endpoint: Send,
impl<Endpoint> Sync for CoapRequest<Endpoint> where
Endpoint: Sync,
impl<Endpoint> Unpin for CoapRequest<Endpoint> where
Endpoint: Unpin,
impl<Endpoint> UnwindSafe for CoapRequest<Endpoint> where
Endpoint: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more