pub struct RawSource<R> { /* private fields */ }Expand description
Reads consecutive rgb24 frames of one size from r.
Implementations§
Source§impl<R: Read> RawSource<R>
impl<R: Read> RawSource<R>
pub fn new(r: R, width: u32, height: u32) -> Self
Sourcepub fn read_frame(&mut self, frame: &mut Frame) -> Result<bool>
pub fn read_frame(&mut self, frame: &mut Frame) -> Result<bool>
Fill frame with the next image, resizing frame to the stream’s
size if it differs. Ok(false) at end of stream; a short final
frame is dropped.
§Errors
Any read error other than an interrupt. On a timeout the bytes read
so far stay in frame and the next call with the same frame
continues the frame.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for RawSource<R>where
R: Freeze,
impl<R> RefUnwindSafe for RawSource<R>where
R: RefUnwindSafe,
impl<R> Send for RawSource<R>where
R: Send,
impl<R> Sync for RawSource<R>where
R: Sync,
impl<R> Unpin for RawSource<R>where
R: Unpin,
impl<R> UnsafeUnpin for RawSource<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for RawSource<R>where
R: UnwindSafe,
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