pub struct SocketOptions {
pub broadcast: bool,
pub reuse_address: bool,
pub reuse_port: bool,
}Expand description
Options applied to a fresh socket before it is bound or connected.
A struct rather than three positional bools because the call sites set
different subsets and a positional triple reads identically whichever two
are swapped.
Fields§
§broadcast: boolSO_BROADCAST. UDP only; asyn’s udp* protocol suffix.
reuse_address: boolSO_REUSEADDR.
reuse_port: boolSO_REUSEPORT, where the platform defines it.
Implementations§
Source§impl SocketOptions
impl SocketOptions
Sourcepub const FANOUT: Self
pub const FANOUT: Self
The datagram-fanout pair: SO_REUSEPORT and SO_REUSEADDR, matching
C epicsSocketEnableAddressUseForDatagramFanout, which sets both.
Sourcepub const REUSE_ADDRESS: Self
pub const REUSE_ADDRESS: Self
SO_REUSEADDR alone, matching C
epicsSocketEnableAddressReuseDuringTimeWaitState. This is what a TCP
listener gets; the fanout helper is SOCK_DGRAM-only.
Trait Implementations§
Source§impl Clone for SocketOptions
impl Clone for SocketOptions
Source§fn clone(&self) -> SocketOptions
fn clone(&self) -> SocketOptions
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 moreimpl Copy for SocketOptions
Source§impl Debug for SocketOptions
impl Debug for SocketOptions
Source§impl Default for SocketOptions
impl Default for SocketOptions
Source§fn default() -> SocketOptions
fn default() -> SocketOptions
Returns the “default value” for a type. Read more
impl Eq for SocketOptions
Source§impl PartialEq for SocketOptions
impl PartialEq for SocketOptions
impl StructuralPartialEq for SocketOptions
Auto Trait Implementations§
impl Freeze for SocketOptions
impl RefUnwindSafe for SocketOptions
impl Send for SocketOptions
impl Sync for SocketOptions
impl Unpin for SocketOptions
impl UnsafeUnpin for SocketOptions
impl UnwindSafe for SocketOptions
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