pub enum CaptureEnd {
Owned {
owner: StreamId,
},
Abandoned {
owner: StreamId,
},
}Expand description
What StreamCapture::end found when it closed the window: the
caller’s own capture, or one belonging to a logical stream that never came
back to close it.
Both close the window. Only the owner gets a graph out of it: the failures raised inside the window doom the recording, and sealing it for a caller that never saw them would hand back a graph silently missing whatever they rejected.
Refusing a foreign caller outright is the worse trade. Several logical
streams share one pooled stream, and a window nobody closes rejects every
read, write and sync that lands on the slot while recording launches into a
graph no one can seal: the slot is lost for the life of the process. A
foreign end_capture is a caller whose StreamId moved out from under it
(see the type docs), which is exactly the case where the owner is gone — so
the window is torn down and the failure reported, rather than kept for an
owner that will never ask.
Variants§
Owned
The caller opened this window: its recording may be sealed into a graph.
Abandoned
The window belonged to owner, not to the caller. It is closed, but
there is no graph to hand back: the backend tears the recording down and
reports, and a later end_capture from owner finds nothing recording.
Implementations§
Source§impl CaptureEnd
impl CaptureEnd
Sourcepub fn is_abandoned(&self) -> bool
pub fn is_abandoned(&self) -> bool
Whether the window was closed for a caller that did not own it, so its recording is torn down instead of sealed.
Sourcepub fn abandoned_error(
&self,
caller: StreamId,
doomed: Option<ServerError>,
) -> ServerError
pub fn abandoned_error( &self, caller: StreamId, doomed: Option<ServerError>, ) -> ServerError
The report a caller gets for closing a window it did not open: why the
recording was discarded, and then doomed — the failure that had
already sunk the recording, if one had, so the caller learns both
reasons rather than only the one that happened to be checked last.
Only meaningful once is_abandoned says so; an
owned window is the caller’s to seal and has nothing to report.
Trait Implementations§
Source§impl Clone for CaptureEnd
impl Clone for CaptureEnd
impl Copy for CaptureEnd
Source§impl Debug for CaptureEnd
impl Debug for CaptureEnd
impl Eq for CaptureEnd
Source§impl PartialEq for CaptureEnd
impl PartialEq for CaptureEnd
impl StructuralPartialEq for CaptureEnd
Auto Trait Implementations§
impl Freeze for CaptureEnd
impl RefUnwindSafe for CaptureEnd
impl Send for CaptureEnd
impl Sync for CaptureEnd
impl Unpin for CaptureEnd
impl UnsafeUnpin for CaptureEnd
impl UnwindSafe for CaptureEnd
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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