pub struct NativeOutputProbeService { /* private fields */ }Expand description
Dedicated native-output probe and calibration-marker worker.
On Linux, connection starts one named thread and each synchronous command
waits at most six seconds. Other platforms return NativeOverlayError::Unsupported.
Dropping or consuming the service sends shutdown and joins the worker.
§Examples
let service: ailloli_ui_winit::NativeOutputProbeService =
ailloli_ui_winit::NativeOutputProbeService::connect().unwrap();
service.shutdown();Implementations§
Source§impl NativeOutputProbeService
Probe lifecycle and synchronous command interface.
impl NativeOutputProbeService
Probe lifecycle and synchronous command interface.
Sourcepub fn connect() -> Result<Self, NativeOverlayError>
pub fn connect() -> Result<Self, NativeOverlayError>
Sourcepub fn snapshot_outputs(
&self,
) -> Result<Vec<NativeOutputDescriptor>, NativeOverlayError>
pub fn snapshot_outputs( &self, ) -> Result<Vec<NativeOutputDescriptor>, NativeOverlayError>
Returns the current generation-stamped output catalogue.
§Errors
Returns Unsupported off Linux, Closed if the worker ended, or a
backend timeout/error if no reply arrives within six seconds.
§Examples
let service = ailloli_ui_winit::NativeOutputProbeService::connect()?;
let outputs: Vec<ailloli_ui_winit::NativeOutputDescriptor> = service.snapshot_outputs()?;Sourcepub fn show_marker(
&self,
descriptor: &NativeOutputDescriptor,
spec: NativeCalibrationMarkerSpec,
) -> Result<NativeCalibrationMarkerGuard, NativeOverlayError>
pub fn show_marker( &self, descriptor: &NativeOutputDescriptor, spec: NativeCalibrationMarkerSpec, ) -> Result<NativeCalibrationMarkerGuard, NativeOverlayError>
Shows a temporary marker for one descriptor and returns its RAII guard.
The worker rejects a descriptor from a stale catalogue generation. Success means the compositor acknowledged and the marker buffer was presented. Only one marker is active; showing another replaces it.
§Errors
Returns platform, stale-descriptor, channel, timeout, or backend failures.
§Examples
let service = ailloli_ui_winit::NativeOutputProbeService::connect()?;
let output = service.snapshot_outputs()?.remove(0);
let guard: ailloli_ui_winit::NativeCalibrationMarkerGuard = service.show_marker(
&output,
ailloli_ui_winit::NativeCalibrationMarkerSpec::new(123, 0),
)?;
guard.hide()?;Sourcepub fn hide_marker(&self) -> Result<(), NativeOverlayError>
pub fn hide_marker(&self) -> Result<(), NativeOverlayError>
Trait Implementations§
Source§impl Debug for NativeOutputProbeService
Hides platform channel details from debug output.
impl Debug for NativeOutputProbeService
Hides platform channel details from debug output.
Auto Trait Implementations§
impl Freeze for NativeOutputProbeService
impl !RefUnwindSafe for NativeOutputProbeService
impl Send for NativeOutputProbeService
impl Sync for NativeOutputProbeService
impl Unpin for NativeOutputProbeService
impl !UnwindSafe for NativeOutputProbeService
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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