[][src]Trait lsl::ExPushable

pub trait ExPushable<T>: HasNominalRate {
    fn push_sample_ex(
        &self,
        data: &T,
        timestamp: f64,
        pushthrough: bool
    ) -> Result<(), Error>; fn push_chunk_ex(
        &self,
        samples: &Vec<T>,
        timestamp: f64,
        pushthrough: bool
    ) -> Result<(), Error> { ... }
fn push_chunk_stamped_ex(
        &self,
        samples: &Vec<T>,
        timestamps: &Vec<f64>,
        pushthrough: bool
    ) -> Result<(), Error> { ... } }

A trait that enables the methods push_sample_ex<T>() and push_chunk_ex<T>(). Implemented by StreamOutlet.

See also the Pushable trait for the simpler methods push_sample<T>() and push_chunk<T>().

Note: If you push in data that as the wrong size (array length not matching the declared number of channels), these functions will trigger an assertion and panic.

Required methods

fn push_sample_ex(
    &self,
    data: &T,
    timestamp: f64,
    pushthrough: bool
) -> Result<(), Error>

Push a vector of values of some type as a sample into the outlet. Each entry in the vector corresponds to one channel. The function handles type checking & conversion.

Arguments:

  • data: A vector of values to push (one for each channel).
  • timestamp: Optionally the capture time of the sample, in agreement with local_clock(); if passed as 0.0, the current time is used.
  • pushthrough: Whether to push the sample through to the receivers instead of buffering it with subsequent samples. Typically this would be true. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.

See also push_sample() for a simpler variant with default values for timestamp and pushthrough (defined in Pushable trait).

Loading content...

Provided methods

fn push_chunk_ex(
    &self,
    samples: &Vec<T>,
    timestamp: f64,
    pushthrough: bool
) -> Result<(), Error>

Push a chunk of samples (batched into a Vec) into the outlet.

Arguments:

  • samples: A Vec of samples, each in a format accepted by push_sample() (e.g., Vec).
  • timestamp: Optionally the capture time of the most recent sample, in agreement with local_clock(); if specified as 0.0, the current time is used. The time stamps of other samples are automatically derived according to the sampling rate of the stream.
  • pushthrough: Whether to push the chunk through to the receivers instead of buffering it with subsequent samples. Typically this would be true. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.

See also push_chunk() for a simpler variant with default values for timestamp and pushthrough (defined in Pushable trait).

fn push_chunk_stamped_ex(
    &self,
    samples: &Vec<T>,
    timestamps: &Vec<f64>,
    pushthrough: bool
) -> Result<(), Error>

Push a chunk of samples (batched into a Vec) into the outlet. Allows for specifying a separate time stamp for each sample (for irregular-rate streams).

Arguments:

  • samples: A Vec of samples, each in a format accepted by push_sample() (e.g., Vec).
  • timestamps: A Vec of capture times for each sample, in agreement with local_clock().
  • pushthrough: Whether to push the chunk through to the receivers instead of buffering it with subsequent samples. Typically this would be true. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
Loading content...

Implementors

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

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

impl ExPushable<Vec<i8>> 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<String>> for StreamOutlet[src]

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

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

Loading content...