pub struct CoapConfig { /* private fields */ }Expand description
Connection settings for a CoapTransport.
Construct with CoapConfig::new and refine with the chained setters; every
field has a sensible default so only the server address is required.
Implementations§
Source§impl CoapConfig
impl CoapConfig
Sourcepub fn new(host: impl Into<String>, port: u16) -> Self
pub fn new(host: impl Into<String>, port: u16) -> Self
Creates a configuration pointing at the given CoAP server.
§Arguments
host- the server hostname or IP address.port- the server UDP port, conventionally5683for plaintext CoAP.
§Returns
A configuration that binds an ephemeral local port, uses confirmable delivery, waits two seconds for the first acknowledgement, and retransmits up to four times.
Sourcepub fn reliability(self, reliability: Reliability) -> Self
pub fn reliability(self, reliability: Reliability) -> Self
Sourcepub fn ack_timeout(self, timeout: Duration) -> Self
pub fn ack_timeout(self, timeout: Duration) -> Self
Sourcepub fn max_retransmits(self, count: u32) -> Self
pub fn max_retransmits(self, count: u32) -> Self
Trait Implementations§
Source§impl Clone for CoapConfig
impl Clone for CoapConfig
Source§fn clone(&self) -> CoapConfig
fn clone(&self) -> CoapConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CoapConfig
impl RefUnwindSafe for CoapConfig
impl Send for CoapConfig
impl Sync for CoapConfig
impl Unpin for CoapConfig
impl UnsafeUnpin for CoapConfig
impl UnwindSafe for CoapConfig
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