Trait windows_capture::capture::WindowsCaptureHandler
source · pub trait WindowsCaptureHandler: Sized {
type Flags;
// Required methods
fn new(flags: Self::Flags) -> Result<Self, Box<dyn Error + Send + Sync>>;
fn on_frame_arrived(
&mut self,
frame: Frame<'_>,
capture_control: InternalCaptureControl
) -> Result<(), Box<dyn Error + Send + Sync>>;
fn on_closed(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>;
// Provided methods
fn start(
settings: WindowsCaptureSettings<Self::Flags>
) -> Result<(), Box<dyn Error + Send + Sync>>
where Self: Send + 'static,
<Self as WindowsCaptureHandler>::Flags: Send { ... }
fn start_free_threaded(
settings: WindowsCaptureSettings<Self::Flags>
) -> CaptureControl
where Self: Send + 'static,
<Self as WindowsCaptureHandler>::Flags: Send { ... }
fn stop(&self) { ... }
}Expand description
Event Handler Trait
Required Associated Types§
Required Methods§
sourcefn new(flags: Self::Flags) -> Result<Self, Box<dyn Error + Send + Sync>>
fn new(flags: Self::Flags) -> Result<Self, Box<dyn Error + Send + Sync>>
Function That Will Be Called To Create The Struct The Flags Can Be Passed From Settings
sourcefn on_frame_arrived(
&mut self,
frame: Frame<'_>,
capture_control: InternalCaptureControl
) -> Result<(), Box<dyn Error + Send + Sync>>
fn on_frame_arrived( &mut self, frame: Frame<'_>, capture_control: InternalCaptureControl ) -> Result<(), Box<dyn Error + Send + Sync>>
Called Every Time A New Frame Is Available
Provided Methods§
sourcefn start(
settings: WindowsCaptureSettings<Self::Flags>
) -> Result<(), Box<dyn Error + Send + Sync>>where
Self: Send + 'static,
<Self as WindowsCaptureHandler>::Flags: Send,
fn start( settings: WindowsCaptureSettings<Self::Flags> ) -> Result<(), Box<dyn Error + Send + Sync>>where Self: Send + 'static, <Self as WindowsCaptureHandler>::Flags: Send,
Starts The Capture And Takes Control Of The Current Thread
sourcefn start_free_threaded(
settings: WindowsCaptureSettings<Self::Flags>
) -> CaptureControlwhere
Self: Send + 'static,
<Self as WindowsCaptureHandler>::Flags: Send,
fn start_free_threaded( settings: WindowsCaptureSettings<Self::Flags> ) -> CaptureControlwhere Self: Send + 'static, <Self as WindowsCaptureHandler>::Flags: Send,
Starts The Capture Without Taking Control Of The Current Thread
Object Safety§
This trait is not object safe.