Skip to main content

RawSource

Struct RawSource 

Source
pub struct RawSource<R> { /* private fields */ }
Expand description

Reads consecutive rgb24 frames of one size from r.

Implementations§

Source§

impl<R: Read> RawSource<R>

Source

pub fn new(r: R, width: u32, height: u32) -> Self

Source

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§

Source§

impl<R: Read> FrameSource for RawSource<R>

Source§

fn next_frame(&mut self, frame: &mut Frame) -> Result<bool>

Fill frame with the next image, resizing it to the source’s size if needed. Ok(false) at the end of the stream. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.