pub enum CaptureError {
Show 13 variants
WindowsUnsupported,
NoOutputs,
EmptyRegion,
RegionOffscreen,
OutputNotFound(String),
WindowNotFound(String),
NoWindowMatches(String),
AmbiguousWindow {
selector: String,
candidates: Vec<String>,
},
InvalidGeometry(String),
CaptureTimeout,
NoVideoEncoder,
SourceTooSmall {
w: u32,
h: u32,
},
Backend {
context: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
}Expand description
An error from the capture engine.
Variants§
WindowsUnsupported
The compositor can’t capture individual windows: no foreign-toplevel image-capture source (wlroots < 0.20 / Sway < 1.12). Screen capture may still work.
NoOutputs
No outputs are available to capture.
EmptyRegion
The requested region has zero area.
RegionOffscreen
The requested region lies outside every output.
OutputNotFound(String)
No output matches the requested name.
WindowNotFound(String)
No window matches the requested id.
NoWindowMatches(String)
No window matches the requested app_id / title filter.
AmbiguousWindow
Several windows match the requested app_id / title filter, so the caller has to
narrow it down. candidates describes the matches well enough to pick one.
Fields
InvalidGeometry(String)
A geometry string was not in X,Y WxH form.
CaptureTimeout
The capture produced no frame before the deadline.
NoVideoEncoder
video only.No usable H.264 encoder is available (NVENC, VAAPI or libx264).
SourceTooSmall
video only.The source is too small to encode.
Backend
A lower-level failure, with a human context and (when there is one) the underlying cause preserved so the error chain survives.
Implementations§
Trait Implementations§
Source§impl Debug for CaptureError
impl Debug for CaptureError
Source§impl Display for CaptureError
impl Display for CaptureError
Source§impl Error for CaptureError
impl Error for CaptureError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for CaptureError
impl !UnwindSafe for CaptureError
impl Freeze for CaptureError
impl Send for CaptureError
impl Sync for CaptureError
impl Unpin for CaptureError
impl UnsafeUnpin for CaptureError
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> 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>. Box<dyn Any> can
then be further downcast into Box<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>. Rc<Any> 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> DowncastSync for T
impl<T> DowncastSync for T
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