pub struct FrameRef { /* private fields */ }Expand description
Reference-counted frame for zero-copy passing.
When a frame needs to be shared between multiple consumers without copying,
use FrameRef to wrap it in an Arc.
Implementations§
Source§impl FrameRef
impl FrameRef
Sourcepub fn new(frame: FilterFrame) -> Self
pub fn new(frame: FilterFrame) -> Self
Create a new frame reference.
Sourcepub fn frame(&self) -> &FilterFrame
pub fn frame(&self) -> &FilterFrame
Get a reference to the inner frame.
Sourcepub fn try_unwrap(self) -> Option<FilterFrame>
pub fn try_unwrap(self) -> Option<FilterFrame>
Try to get exclusive access to the frame.
Returns Some if this is the only reference, None otherwise.
Sourcepub fn make_mut(self) -> FilterFrame
pub fn make_mut(self) -> FilterFrame
Make a copy of the frame if needed for mutation.
If this is the only reference, returns the frame directly. Otherwise, clones the frame.
Trait Implementations§
Source§impl From<AudioFrame> for FrameRef
impl From<AudioFrame> for FrameRef
Source§fn from(frame: AudioFrame) -> Self
fn from(frame: AudioFrame) -> Self
Converts to this type from the input type.
Source§impl From<FilterFrame> for FrameRef
impl From<FilterFrame> for FrameRef
Source§fn from(frame: FilterFrame) -> Self
fn from(frame: FilterFrame) -> Self
Converts to this type from the input type.
Source§impl From<VideoFrame> for FrameRef
impl From<VideoFrame> for FrameRef
Source§fn from(frame: VideoFrame) -> Self
fn from(frame: VideoFrame) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for FrameRef
impl RefUnwindSafe for FrameRef
impl Send for FrameRef
impl Sync for FrameRef
impl Unpin for FrameRef
impl UnsafeUnpin for FrameRef
impl UnwindSafe for FrameRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more