[−][src]Struct net2::UdpBuilder
An "in progress" UDP socket which has not yet been connected.
Allows configuration of a socket before the socket is connected.
Methods
impl UdpBuilder
[src]
impl UdpBuilder
pub fn new_v4() -> Result<UdpBuilder>
[src]
pub fn new_v4() -> Result<UdpBuilder>
Constructs a new UdpBuilder with the AF_INET
domain, the SOCK_DGRAM
type, and with a protocol argument of 0.
Note that passing other kinds of flags or arguments can be done through
the FromRaw{Fd,Socket}
implementation.
pub fn new_v6() -> Result<UdpBuilder>
[src]
pub fn new_v6() -> Result<UdpBuilder>
Constructs a new UdpBuilder with the AF_INET6
domain, the SOCK_DGRAM
type, and with a protocol argument of 0.
Note that passing other kinds of flags or arguments can be done through
the FromRaw{Fd,Socket}
implementation.
pub fn bind<T>(&self, addr: T) -> Result<UdpSocket> where
T: ToSocketAddrs,
[src]
pub fn bind<T>(&self, addr: T) -> Result<UdpSocket> where
T: ToSocketAddrs,
Binds this socket to the specified address.
This function directly corresponds to the bind(2) function on Windows and Unix.
impl UdpBuilder
[src]
impl UdpBuilder
pub fn ttl(&self, ttl: u32) -> Result<&Self>
[src]
pub fn ttl(&self, ttl: u32) -> Result<&Self>
Sets the value for the IP_TTL
option on this socket.
This is the same as TcpStreamExt::set_ttl
.
pub fn only_v6(&self, only_v6: bool) -> Result<&Self>
[src]
pub fn only_v6(&self, only_v6: bool) -> Result<&Self>
Sets the value for the IPV6_V6ONLY
option on this socket.
This is the same as TcpStream::only_v6
.
pub fn reuse_address(&self, reuse: bool) -> Result<&Self>
[src]
pub fn reuse_address(&self, reuse: bool) -> Result<&Self>
Set value for the SO_REUSEADDR
option on this socket.
This is the same as TcpBuilder::reuse_address
.
pub fn get_reuse_address(&self) -> Result<bool>
[src]
pub fn get_reuse_address(&self) -> Result<bool>
Check the SO_REUSEADDR
option on this socket.
pub fn take_error(&self) -> Result<Option<Error>>
[src]
pub fn take_error(&self) -> Result<Option<Error>>
Get the value of the SO_ERROR
option on this socket.
This will retrieve the stored error in the underlying socket, clearing the field in the process. This can be useful for checking errors between calls.
Trait Implementations
impl UnixUdpBuilderExt for UdpBuilder
[src]
impl UnixUdpBuilderExt for UdpBuilder
fn reuse_port(&self, reuse: bool) -> Result<&Self>
[src]
fn reuse_port(&self, reuse: bool) -> Result<&Self>
Set value for the SO_REUSEPORT
option on this socket. Read more
fn get_reuse_port(&self) -> Result<bool>
[src]
fn get_reuse_port(&self) -> Result<bool>
Check the value of the SO_REUSEPORT
option on this socket.
impl Debug for UdpBuilder
[src]
impl Debug for UdpBuilder
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl FromRawFd for UdpBuilder
[src]
impl FromRawFd for UdpBuilder
unsafe fn from_raw_fd(fd: c_int) -> UdpBuilder
[src]
unsafe fn from_raw_fd(fd: c_int) -> UdpBuilder
Constructs a new instance of Self
from the given raw file descriptor. Read more
impl AsRawFd for UdpBuilder
[src]
impl AsRawFd for UdpBuilder
Auto Trait Implementations
impl Send for UdpBuilder
impl Send for UdpBuilder
impl !Sync for UdpBuilder
impl !Sync for UdpBuilder
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more