pub struct MediaReceiverReservation { /* private fields */ }Expand description
Provisional ownership of a stream’s single-consumer inbound receiver.
Dropping an uncommitted reservation restores the receiver to its stream. This lets an orchestrator reserve every source needed by a multi-leg media operation before transferring any one source into a graph. Committing is the explicit point at which rollback is disabled and the caller becomes the receiver’s permanent owner.
Implementations§
Source§impl MediaReceiverReservation
impl MediaReceiverReservation
Sourcepub fn new(
receiver: Receiver<MediaFrame>,
restore: impl FnOnce(Receiver<MediaFrame>) + Send + 'static,
) -> MediaReceiverReservation
pub fn new( receiver: Receiver<MediaFrame>, restore: impl FnOnce(Receiver<MediaFrame>) + Send + 'static, ) -> MediaReceiverReservation
Create a rollback-capable receiver reservation.
Sourcepub fn with_commit_hook(
self,
on_commit: impl FnOnce() + Send + 'static,
) -> MediaReceiverReservation
pub fn with_commit_hook( self, on_commit: impl FnOnce() + Send + 'static, ) -> MediaReceiverReservation
Install a hook that runs only when provisional ownership is committed.
This is primarily useful for ownership accounting. A rolled-back reservation must not be counted as a destructive receiver acquisition.
Sourcepub fn commit(self) -> Receiver<MediaFrame>
pub fn commit(self) -> Receiver<MediaFrame>
Transfer permanent ownership of the reserved receiver to the caller.
Trait Implementations§
Source§impl Drop for MediaReceiverReservation
impl Drop for MediaReceiverReservation
Auto Trait Implementations§
impl !RefUnwindSafe for MediaReceiverReservation
impl !Sync for MediaReceiverReservation
impl !UnwindSafe for MediaReceiverReservation
impl Freeze for MediaReceiverReservation
impl Send for MediaReceiverReservation
impl Unpin for MediaReceiverReservation
impl UnsafeUnpin for MediaReceiverReservation
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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