pub trait GraphicsCaptureApiHandler: Sized {
type Flags;
type Error: Send + Sync;
// Required methods
fn new(ctx: Context<Self::Flags>) -> Result<Self, Self::Error>;
fn on_frame_arrived(
&mut self,
frame: &mut Frame<'_>,
capture_control: InternalCaptureControl,
) -> Result<(), Self::Error>;
// Provided methods
fn start<T: TryInto<GraphicsCaptureItemType>>(
settings: Settings<Self::Flags, T>,
) -> Result<(), GraphicsCaptureApiError<Self::Error>>
where Self: Send + 'static,
<Self as GraphicsCaptureApiHandler>::Flags: Send { ... }
fn start_free_threaded<T: TryInto<GraphicsCaptureItemType> + Send + 'static>(
settings: Settings<Self::Flags, T>,
) -> Result<CaptureControl<Self, Self::Error>, GraphicsCaptureApiError<Self::Error>>
where Self: Send + 'static,
<Self as GraphicsCaptureApiHandler>::Flags: Send { ... }
fn on_closed(&mut self) -> Result<(), Self::Error> { ... }
}Expand description
Trait implemented by types that handle graphics capture events.
Required Associated Types§
Sourcetype Error: Send + Sync
type Error: Send + Sync
The type of error that can occur during capture. The error will be returned from the
CaptureControl and GraphicsCaptureApiHandler::start functions.
Required Methods§
Sourcefn new(ctx: Context<Self::Flags>) -> Result<Self, Self::Error>
fn new(ctx: Context<Self::Flags>) -> Result<Self, Self::Error>
Function that will be called to create the struct. The flags can be passed from settings.
Sourcefn on_frame_arrived(
&mut self,
frame: &mut Frame<'_>,
capture_control: InternalCaptureControl,
) -> Result<(), Self::Error>
fn on_frame_arrived( &mut self, frame: &mut Frame<'_>, capture_control: InternalCaptureControl, ) -> Result<(), Self::Error>
Called every time a new frame is available.
Provided Methods§
Sourcefn start<T: TryInto<GraphicsCaptureItemType>>(
settings: Settings<Self::Flags, T>,
) -> Result<(), GraphicsCaptureApiError<Self::Error>>
fn start<T: TryInto<GraphicsCaptureItemType>>( settings: Settings<Self::Flags, T>, ) -> Result<(), GraphicsCaptureApiError<Self::Error>>
Starts the capture and takes control of the current thread.
Sourcefn start_free_threaded<T: TryInto<GraphicsCaptureItemType> + Send + 'static>(
settings: Settings<Self::Flags, T>,
) -> Result<CaptureControl<Self, Self::Error>, GraphicsCaptureApiError<Self::Error>>
fn start_free_threaded<T: TryInto<GraphicsCaptureItemType> + Send + 'static>( settings: Settings<Self::Flags, T>, ) -> Result<CaptureControl<Self, Self::Error>, GraphicsCaptureApiError<Self::Error>>
Starts the capture without taking control of the current thread.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.