pub struct FeedClient { /* private fields */ }Expand description
The client side of a data feed.
Implementations§
Source§impl FeedClient
impl FeedClient
Sourcepub fn start(
params: FeedParams,
format: Format,
channels: usize,
) -> (Self, Vec<u8>)
pub fn start( params: FeedParams, format: Format, channels: usize, ) -> (Self, Vec<u8>)
Build a client and return the bytes to send.
Sourcepub fn start_with(
params: FeedParams,
format: Format,
channels: usize,
offer: Vec<Token>,
) -> (Self, Vec<u8>)
pub fn start_with( params: FeedParams, format: Format, channels: usize, offer: Vec<Token>, ) -> (Self, Vec<u8>)
Build a client that offers features, and return the bytes to send.
With no tokens, this is the same as FeedClient::start.
docs/extensions.md.
Sourcepub fn features(&self) -> &[Token]
pub fn features(&self) -> &[Token]
The features that are on for this connection. Empty until the headers arrive, and empty when the outlet gave no answer for them.
Sourcepub fn agreement(&self) -> Option<&FeedAgreement>
pub fn agreement(&self) -> Option<&FeedAgreement>
What the answer settled. Available once the headers arrive.
Sourcepub fn codec(&self) -> Option<&Codec>
pub fn codec(&self) -> Option<&Codec>
The codec for the sample stream. Available once the headers arrive.
Sourcepub fn on_headers(&mut self, buf: &[u8]) -> Result<usize, Error>
pub fn on_headers(&mut self, buf: &[u8]) -> Result<usize, Error>
Read the answer headers.
Returns the number of bytes used. A buffer with no complete block
returns Error::Incomplete, and the caller reads more bytes.
Sourcepub fn on_test_pattern(&mut self, buf: &[u8]) -> Result<usize, TestPatternError>
pub fn on_test_pattern(&mut self, buf: &[u8]) -> Result<usize, TestPatternError>
Read the two test pattern samples and compare them. SPEC.md 6.
The client builds the expected samples itself. A mismatch means the formats differ, and liblsl stops the feed with a named error.
Returns the number of bytes used.