[][src]Struct lsl::StreamOutlet

pub struct StreamOutlet { /* fields omitted */ }

A stream outlet. Outlets are used to make streaming data (and the meta-data) available on the lab network.

The actual sample-pushing functionality is provided via the Pushable and ExPushable traits below.

Examples: the send_*.rs examples (found in the crate's github repository) illustrate the use of StreamOutlet.

Implementations

impl StreamOutlet[src]

pub fn new(
    info: &StreamInfo,
    chunk_size: i32,
    max_buffered: i32
) -> Result<StreamOutlet, Error>
[src]

Establish a new stream outlet. This makes the stream discoverable.

Arguments:

  • info: The stream information to use for creating this stream. Stays constant over the lifetime of the outlet.
  • chunk_size: The desired chunk granularity (in samples) for transmission. If specified as 0, each push operation yields one chunk. Inlets can override this setting.
  • max_buffered: The maximum amount of data to buffer (in seconds if there is a nominal sampling rate, otherwise x100 in samples). A good default is 360, which corresponds to 6 minutes of data. Note that, for high-bandwidth data you should consider using a lower value here to avoid running out of RAM in case data have to be buffered unexpectedly.

pub fn have_consumers(&self) -> bool[src]

Check whether consumers are currently registered.

You can use this to disable sending data if there's no consumer (e.g. to save battery on an embedded device) -- however, this is not necessary and most production clients do not use it.

pub fn wait_for_consumers(&self, timeout: f64) -> bool[src]

Wait until some consumer shows up (without wasting resources, e.g., on embedded devices).

To have no timeout, you can use the value lsl::FOREVER here. Returns True if the wait was successful, false if the timeout expired.

Note that it is not necessary to do this, and most production clients do not use this feature.

pub fn info(&self) -> Result<StreamInfo, Error>[src]

Retrieve the stream info provided by this outlet.

This is what was used to create the stream (and also has the Additional Network Information fields assigned).

In extremely rare cases this may fail with an Err::ResourceCreation variant (e.g., due to out of memory).

Trait Implementations

impl Debug for StreamOutlet[src]

impl Drop for StreamOutlet[src]

impl<'_> ExPushable<Vec<&'_ [u8]>> for StreamOutlet[src]

impl<'_> ExPushable<Vec<&'_ str>> for StreamOutlet[src]

impl ExPushable<Vec<String>> for StreamOutlet[src]

impl ExPushable<Vec<f32>> for StreamOutlet[src]

impl ExPushable<Vec<f64>> for StreamOutlet[src]

impl ExPushable<Vec<i16>> for StreamOutlet[src]

impl ExPushable<Vec<i32>> for StreamOutlet[src]

impl ExPushable<Vec<i64>> for StreamOutlet[src]

impl ExPushable<Vec<i8>> for StreamOutlet[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> Pushable<T> for U where
    U: ExPushable<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.