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 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.
Auto Trait Implementations§
impl Forget for FeedClient
impl Freeze for FeedClient
impl Move for FeedClient
impl RefUnwindSafe for FeedClient
impl Send for FeedClient
impl Sync for FeedClient
impl Unpin for FeedClient
impl UnsafeUnpin for FeedClient
impl UnwindSafe for FeedClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more