Struct SendPost

Source
pub struct SendPost<IC>(/* private fields */);
Expand description

Send descriptor created by CoapRequest::post used for sending CoAP POST requests.

Implementations§

Source§

impl<IC> SendPost<IC>

Source

pub fn nonconfirmable(self) -> Nonconfirmable<SendPost<IC>>

Returns a nonconfirmable version of this send descriptor.

Source

pub fn multicast(self) -> Multicast<SendPost<IC>>

Returns a multicast version of this send descriptor.

Trait Implementations§

Source§

impl<IC: Debug> Debug for SendPost<IC>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<IC> Default for SendPost<IC>

Source§

fn default() -> Self

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

impl<IC: InboundContext> SendDesc<IC> for SendPost<IC>

Source§

fn write_options( &self, _msg: &mut dyn OptionInsert, _socket_addr: &IC::SocketAddr, _start: Bound<OptionNumber>, _end: Bound<OptionNumber>, ) -> Result<(), Error>

Defines which options are going to be included in the outbound message. Read more
Source§

fn write_payload( &self, msg: &mut dyn MessageWrite, _socket_addr: &IC::SocketAddr, ) -> Result<(), Error>

Generates the outbound message by making calls into msg.
Source§

fn handler( &mut self, context: Result<&IC, Error>, ) -> Result<ResponseStatus<()>, Error>

Handles the response to the outbound message.
Source§

fn trans_params(&self) -> Option<TP>

Experimental: Gets custom transmission parameters.
Source§

fn supports_option(&self, option: OptionNumber) -> bool

Experimental: Used for determining if the given option seen in the reply message is supported or not. Read more
Source§

fn delay_to_retransmit(&self, retransmits_sent: u32) -> Option<Duration>

Calculates the duration of the delay to wait before sending the next retransmission. Read more
Source§

fn delay_to_restart(&self) -> Option<Duration>

The delay to wait between when we have received a successful response and when we should send out another request. Read more
Source§

fn max_rtt(&self) -> Duration

The maximum time to wait for an asynchronous response after having received an ACK.
Source§

fn transmit_wait_duration(&self) -> Duration

the maximum time from the first transmission of a Confirmable message to the time when the sender gives up on receiving an acknowledgement or reset.
Source§

impl<IC> SendDescUnicast for SendPost<IC>

Source§

fn block2<IC, R, TP>(self, block2: Option<BlockInfo>) -> UnicastBlock2<Self, IC>
where IC: InboundContext, R: Send, TP: TransParams, Self: SendDesc<IC, R, TP> + Sized,

Returns a send descriptor that will perform Block2 processing. Read more

Auto Trait Implementations§

§

impl<IC> Freeze for SendPost<IC>

§

impl<IC> RefUnwindSafe for SendPost<IC>
where IC: RefUnwindSafe,

§

impl<IC> Send for SendPost<IC>
where IC: Send,

§

impl<IC> Sync for SendPost<IC>
where IC: Sync,

§

impl<IC> Unpin for SendPost<IC>
where IC: Unpin,

§

impl<IC> UnwindSafe for SendPost<IC>
where IC: UnwindSafe,

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, IC, R, TP> SendDescExt<IC, R, TP> for T
where T: SendDesc<IC, R, TP>, IC: InboundContext, R: Send, TP: TransParams,

Source§

fn add_option_iter<K, I>( self, key: OptionKey<K>, viter: I, ) -> AddOption<Self, K, I, IC>
where I: IntoIterator<Item = K> + Send + Clone, K: Send + Clone,

Adds zero or more instances of the option key, using values coming from viter. Read more
Source§

fn add_option<K>( self, key: OptionKey<K>, value: K, ) -> AddOption<Self, K, Once<K>, IC>
where K: Send + Clone,

Adds one instance of the option key with a value of value.
Source§

fn accept( self, accept: ContentFormat, ) -> AddOption<Self, ContentFormat, Once<ContentFormat>, IC>

Adds an Accept option with the given ContentFormat.
Source§

fn content_format( self, content_format: ContentFormat, ) -> AddOption<Self, ContentFormat, Once<ContentFormat>, IC>

Adds an Content-Format option with the given ContentFormat.
Source§

fn use_handler<F, FR>(self, handler: F) -> Handler<Self, F>
where F: FnMut(Result<&dyn InboundContext<SocketAddr = IC::SocketAddr>, Error>) -> Result<ResponseStatus<FR>, Error> + Send, FR: Send,

Adds a handler function to be called when a response message has been received (or when an error has occurred).
Source§

fn emit_any_response(self) -> EmitAnyResponse<Self>

Updates the send descriptor chain to emit any received message as a result, even if that message has a message code that indicates an error.
Source§

fn emit_successful_response(self) -> EmitSuccessfulResponse<Self>

Updates the send descriptor chain to emit received message as a result, but only if that message has a message code that indicates success.
Source§

fn emit_msg_code(self) -> EmitMsgCode<Self>

Updates the send descriptor chain to emit only the message code of the received response.
Source§

fn include_socket_addr(self) -> IncludeSocketAddr<Self>

Updates the send descriptor chain to also emit the SocketAddr of the sender of the response, resulting in tuple return type. Read more
Source§

fn inspect<F>(self, inspect: F) -> Inspect<Self, F>
where F: FnMut(&dyn InboundContext<SocketAddr = IC::SocketAddr>) + Send,

Adds an inspection closure that will be called for each received response message. Read more
Source§

fn payload_writer<F>(self, writer: F) -> PayloadWriter<Self, F>
where F: Fn(&mut dyn MessageWrite) -> Result<(), Error> + Send,

Adds a closure that writes to the payload of the outbound message.
Source§

fn uri_host_path<T: Into<RelRefBuf>>( self, host: Option<String>, uri_path: T, ) -> UriHostPath<Self, IC>

Allows you to specify the URI_HOST, URI_PATH, and URI_QUERY option values in a more convenient way than using add_option_iter manually.
Source§

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

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V