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]

Returns the "default value" for a type. Read more

impl Clone for Broadcast
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<P: Protocol> SocketOption<P> for Broadcast
[src]

impl<P: Protocol> GetSocketOption<P> for Broadcast
[src]

impl<P: Protocol> SetSocketOption<P> for Broadcast
[src]