pub struct ScreencastFrame {
pub data: Bytes,
}Expand description
A single frame emitted while a screencast is active. Wire format is
JPEG; data holds the raw bytes ready to write to disk or pass to
an image decoder.
data is a bytes::Bytes handle so the decoded JPEG is allocated
exactly once per frame and cloning into each registered handler is
a refcount bump rather than a memcpy. Bytes implements
Deref<Target = [u8]>, so existing reads (frame.data.len(),
&frame.data[..], tokio::fs::write(path, &frame.data)) compile
unchanged from the previous Vec<u8> shape.
Fields§
§data: BytesJPEG-encoded frame bytes.
Trait Implementations§
Source§impl Clone for ScreencastFrame
impl Clone for ScreencastFrame
Source§fn clone(&self) -> ScreencastFrame
fn clone(&self) -> ScreencastFrame
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for ScreencastFrame
impl RefUnwindSafe for ScreencastFrame
impl Send for ScreencastFrame
impl Sync for ScreencastFrame
impl Unpin for ScreencastFrame
impl UnsafeUnpin for ScreencastFrame
impl UnwindSafe for ScreencastFrame
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