[−][src]Trait lsl::ExPushable
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>
&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 withlocal_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 betrue
. Note that thechunk_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).
Provided methods
fn push_chunk_ex(
&self,
samples: &Vec<T>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
&self,
samples: &Vec<T>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
Push a chunk of samples (batched into a Vec
) into the outlet.
Arguments:
samples
: AVec
of samples, each in a format accepted bypush_sample()
(e.g.,Vec
).timestamp
: Optionally the capture time of the most recent sample, in agreement withlocal_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 betrue
. Note that thechunk_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>
&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
: AVec
of samples, each in a format accepted bypush_sample()
(e.g.,Vec
).timestamps
: AVec
of capture times for each sample, in agreement withlocal_clock()
.pushthrough
: Whether to push the chunk through to the receivers instead of buffering it with subsequent samples. Typically this would betrue
. Note that thechunk_size
, if specified at outlet construction, takes precedence over the pushthrough flag.
Implementors
impl ExPushable<Vec<f32>> for StreamOutlet
[src]
fn push_sample_ex(
&self,
data: &Vec<f32>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
[src]
&self,
data: &Vec<f32>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
impl ExPushable<Vec<f64>> for StreamOutlet
[src]
fn push_sample_ex(
&self,
data: &Vec<f64>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
[src]
&self,
data: &Vec<f64>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
impl ExPushable<Vec<i8>> for StreamOutlet
[src]
fn push_sample_ex(
&self,
data: &Vec<i8>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
[src]
&self,
data: &Vec<i8>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
impl ExPushable<Vec<i16>> for StreamOutlet
[src]
fn push_sample_ex(
&self,
data: &Vec<i16>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
[src]
&self,
data: &Vec<i16>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
impl ExPushable<Vec<i32>> for StreamOutlet
[src]
fn push_sample_ex(
&self,
data: &Vec<i32>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
[src]
&self,
data: &Vec<i32>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
impl ExPushable<Vec<i64>> for StreamOutlet
[src]
fn push_sample_ex(
&self,
data: &Vec<i64>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
[src]
&self,
data: &Vec<i64>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
impl ExPushable<Vec<String>> for StreamOutlet
[src]
fn push_sample_ex(
&self,
data: &Vec<String>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
[src]
&self,
data: &Vec<String>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
impl<'_> ExPushable<Vec<&'_ str>> for StreamOutlet
[src]
fn push_sample_ex(
&self,
data: &Vec<&str>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>
[src]
&self,
data: &Vec<&str>,
timestamp: f64,
pushthrough: bool
) -> Result<(), Error>