pub struct SocketOption {
pub ip_version: IpVersion,
pub socket_type: SocketType,
pub protocol: Option<IpNextLevelProtocol>,
pub timeout: Option<u64>,
pub ttl: Option<u32>,
pub non_blocking: bool,
}
Expand description
Socket option.
Fields§
§ip_version: IpVersion
IP version
socket_type: SocketType
Socket type
protocol: Option<IpNextLevelProtocol>
Protocol. TCP, UDP, ICMP, etc.
timeout: Option<u64>
Timeout
ttl: Option<u32>
TTL or Hop Limit
non_blocking: bool
Non-blocking mode
Implementations§
Source§impl SocketOption
impl SocketOption
Sourcepub fn new(
ip_version: IpVersion,
socket_type: SocketType,
protocol: Option<IpNextLevelProtocol>,
) -> SocketOption
pub fn new( ip_version: IpVersion, socket_type: SocketType, protocol: Option<IpNextLevelProtocol>, ) -> SocketOption
Constructs a new SocketOption.
Trait Implementations§
Source§impl Clone for SocketOption
impl Clone for SocketOption
Source§fn clone(&self) -> SocketOption
fn clone(&self) -> SocketOption
Returns a duplicate of the value. Read more
1.0.0 · 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 SocketOption
impl RefUnwindSafe for SocketOption
impl Send for SocketOption
impl Sync for SocketOption
impl Unpin for SocketOption
impl UnwindSafe for SocketOption
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