[−][src]Struct nannou_laser::Api
A general API that allows for detecting and enumerating laser DACs on a network and establishing new streams of communication with them.
Implementations
impl Api
[src]
pub fn new() -> Self
[src]
Instantiate the laser API.
pub fn detect_dacs(&self) -> Result<DetectDacs>
[src]
An iterator yielding laser DACs available on the system as they are discovered.
Currently, the only laser protocol supported is the ether dream protocol. Thus, this enumerates ether dream DACs that are discovered on the LAN.
Note that the produced iterator will iterate forever and never terminate unless
set_timeout
is called on the returned DetectDacs
instance.
pub fn detect_dac(&self, id: DacId) -> Result<DetectedDac>
[src]
Block and wait until the DAC with the given Id
is detected.
pub fn detect_dacs_async<F>(
&self,
timeout: Option<Duration>,
callback: F
) -> Result<DetectDacsAsync> where
F: 'static + DetectedDacCallback + Send,
[src]
&self,
timeout: Option<Duration>,
callback: F
) -> Result<DetectDacsAsync> where
F: 'static + DetectedDacCallback + Send,
Spawn a thread for DAC detection.
Calls the given callback
with broadcasts as they are received.
The thread is closed when the returned DetectDacsAsync
instance is dropped.
pub fn new_frame_stream<M, F>(&self, model: M, render: F) -> Builder<M, F> where
F: RenderFn<M>,
[src]
F: RenderFn<M>,
Begin building a new laser frame stream.
The stream will call the render
function each time new points are needed to feed the
laser DAC buffer. The rate at which this will be called depends on the point_hz
,
frame_hz
and the latency_points
.
pub fn new_raw_stream<M, F>(&self, model: M, render: F) -> Builder<M, F> where
F: RenderFn<M>,
[src]
F: RenderFn<M>,
Begin building a new laser raw stream.
The raw stream will call the given render
function with a request for as many points as
the DAC currently might need to fill the buffer based on the stream latency.
Auto Trait Implementations
impl RefUnwindSafe for Api
impl Send for Api
impl Sync for Api
impl Unpin for Api
impl UnwindSafe for Api
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>,