[−][src]Struct ether_dream_dac_emulator::broadcaster::Broadcaster
The broadcasting side of the DAC.
Once run
is called, the broadcaster will block and loop at a rate of once-per-second,
broadcasting the current state of the DAC on each iteration.
Methods
impl Broadcaster
[src]
pub fn new(
dac: Addressed,
bind_port: u16,
broadcast_ip: Ipv4Addr
) -> Result<Broadcaster>
[src]
dac: Addressed,
bind_port: u16,
broadcast_ip: Ipv4Addr
) -> Result<Broadcaster>
Create a new Broadcaster initialised with the given DAC state.
Produces an io::Error if creating the UDP socket fails or if enabling broadcast fails.
pub fn create_broadcast(&self) -> DacBroadcast
[src]
Creates a DacBroadcast from the current known DAC state.
This is used within the send method.
pub fn send(&mut self) -> Result<()>
[src]
Sends a single broadcast message over the inner UDP socket.
pub fn run(&mut self, rx: Rx) -> Result<()>
[src]
Run the Broadcaster.
The broadcaster will block on the given receiver, waiting to process Messages.
On each Message::Second received, the Broadcaster will send a message over UDP.
On each Message::Dac, the Broadcaster will update the current DAC state.
pub fn spawn(self) -> Result<Handle>
[src]
Consumes the Broadcaster and calls the run method on a separate thread.
Auto Trait Implementations
impl RefUnwindSafe for Broadcaster
impl Send for Broadcaster
impl Sync for Broadcaster
impl Unpin for Broadcaster
impl UnwindSafe for Broadcaster
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,