pub struct U3vFrameStream { /* private fields */ }Expand description
Async frame iterator wrapping blocking USB3 Vision bulk reads.
Internally spawns a blocking reader thread that calls
U3vStream::next_frame() in a loop and sends converted Frame
values through an mpsc channel. The async consumer reads from the
channel via next_frame().
§Example
ⓘ
let u3v_stream = device.open_stream(payload_size)?;
let mut frames = U3vFrameStream::start(u3v_stream);
while let Some(frame) = frames.next_frame().await? {
println!("{}x{} frame", frame.width, frame.height);
}
frames.stop();Implementations§
Source§impl U3vFrameStream
impl U3vFrameStream
Sourcepub fn start<T: UsbTransfer + 'static>(stream: U3vStream<T>) -> Self
pub fn start<T: UsbTransfer + 'static>(stream: U3vStream<T>) -> Self
Sourcepub async fn next_frame(&mut self) -> Result<Option<Frame>, GenicamError>
pub async fn next_frame(&mut self) -> Result<Option<Frame>, GenicamError>
Receive the next complete frame.
Returns Ok(None) when the stream ends (reader stopped or errored).
Auto Trait Implementations§
impl Freeze for U3vFrameStream
impl RefUnwindSafe for U3vFrameStream
impl Send for U3vFrameStream
impl Sync for U3vFrameStream
impl Unpin for U3vFrameStream
impl UnsafeUnpin for U3vFrameStream
impl UnwindSafe for U3vFrameStream
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