#[non_exhaustive]pub enum Error {
Mpv(Error),
AlreadyAttached,
RenderBackendMismatch,
NotAttached,
}Expand description
Everything this crate’s fallible calls can return.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Mpv(Error)
An error from libmpv itself, via rsmpv (its Display carries
mpv’s mpv_error_string text plus the numeric code).
AlreadyAttached
An attach called while a render context is already live. mpv supports exactly one render context per handle, of either backend.
RenderBackendMismatch
A render call against the wrong attached backend (e.g. render_gl
while the software context is attached) — a wiring bug in the
shell, surfaced loudly rather than silently dropped.
NotAttached
A call that needs a live render context ran before any attach.
Today only
Engine::set_render_update_callback
returns this — a callback that could never fire is a wiring bug,
surfaced loudly like
RenderBackendMismatch. The frame
path deliberately does not use it: unattached,
render_gl/render_sw return Ok untouched and render_update
returns false, because “not attached yet” is an ordinary
startup state there, not a bug — don’t match on this variant to
detect a missing attach from a draw handler.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()