Struct asyncio::socket_base::Broadcast
[−]
[src]
pub struct Broadcast(_);
socket option to permit sending of broadcast messages.
Implements the SOL_SOCKET/SO_BROADCAST socket option.
Examples
Setting the option:
use asyncio::*; use asyncio::ip::*; use asyncio::socket_base::Broadcast; let ctx = &IoContext::new().unwrap(); let soc = UdpSocket::new(ctx, Udp::v4()).unwrap(); soc.set_option(Broadcast::new(true)).unwrap();
Getting the option:
use asyncio::*; use asyncio::ip::*; use asyncio::socket_base::Broadcast; let ctx = &IoContext::new().unwrap(); let soc = UdpSocket::new(ctx, Udp::v4()).unwrap(); let opt: Broadcast = soc.get_option().unwrap(); let is_set: bool = opt.get();
Methods
impl Broadcast
[src]
Trait Implementations
impl Default for Broadcast
[src]
impl Clone for Broadcast
[src]
fn clone(&self) -> Broadcast
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more