Skip to main content

HostRecorder

Struct HostRecorder 

pub struct HostRecorder { /* private fields */ }
Expand description

What a HostServices::recording host was asked to do, and the answers it will give.

Copies round-trip through an in-process clipboard; pickers and launches answer queued outcomes, then Cancelled (launches: Opened); location requests answer queued fixes, then Unavailable; screen-capture requests answer queued outcomes, then Cancelled; URIs, utterances and notifications are recorded; media sessions start and record what the player publishes.

Implementations§

§

impl HostRecorder

pub fn copies(&self) -> Vec<(ClipboardTarget, String)>

Every text copy, in order.

pub fn copy_image_elsewhere(&self, image: ClipboardImage)

Another app copies image, as a screenshot tool does: the next paste reads it, until something copies text.

pub fn opened_uris(&self) -> Vec<String>

Every URI handed to the opener, in order.

pub fn pick_requests(&self) -> Vec<PickRequest>

Every chooser request, in order.

pub fn launch_requests(&self) -> Vec<LaunchRequest>

Every desktop-open request, in order.

pub fn respond_to_pick(&self, outcome: PortalOutcome)

Answer the next single-file chooser with outcome.

pub fn respond_to_pick_multiple(&self, outcome: MultiOutcome)

Answer the next multi-select chooser with outcome.

pub fn respond_to_open_file(&self, outcome: OpenFileOutcome)

Answer the next descriptor-retaining chooser with outcome.

pub fn respond_to_launch(&self, outcome: LaunchOutcome)

Answer the next desktop-open request with outcome.

pub fn respond_to_location(&self, outcome: LocationOutcome)

Answer the next location request with outcome.

pub fn location_requests(&self) -> usize

How many location fixes were requested.

pub fn screen_capture_requests(&self) -> Vec<ScreenCaptureRequest>

Every screen-capture request, in order.

pub fn utterances(&self) -> Vec<Utterance>

Everything the screen reader was asked to say, in order.

pub fn notifications(&self) -> Vec<Notification>

Every notification shown, in order.

pub fn media_sessions(&self) -> Vec<MprisConfig>

The configuration of every media session started, in order.

pub fn published_media_state(&self) -> Vec<PlayerSnapshot>

Every player state published to a media session, in order.

Trait Implementations§

§

impl Clone for HostRecorder

§

fn clone(&self) -> HostRecorder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Default for HostRecorder

§

fn default() -> HostRecorder

Returns the “default value” for a type. Read more
§

impl FilePicker for HostRecorder

§

fn pick(&self, request: PickRequest) -> Receiver<PortalOutcome>

A single-file Open, Save or folder chooser.
§

fn pick_multiple(&self, request: PickRequest) -> Receiver<MultiOutcome>

A multi-select Open chooser.
§

fn open_file(&self, request: PickRequest) -> Receiver<OpenFileOutcome>

A single-file Open chooser that delivers the already-open descriptor.
§

fn launch(&self, request: LaunchRequest) -> Receiver<LaunchOutcome>

Open a local path with its default handler, or reveal its folder.
§

fn save_file(&self, request: PickRequest) -> Receiver<OpenFileOutcome>

A Save chooser that delivers the chosen destination already open for writing, for hosts whose documents have no path the app can write to. Hosts that answer Save with a path keep this default refusal.
§

fn pick_contents(&self, request: PickRequest) -> Receiver<ContentsOutcome>

An Open chooser that delivers the chosen files’ contents. The default reads what pick or pick_multiple answers; a host without local paths (a browser page) implements it directly. Implementations must enforce the aggregate PickRequest::contents_byte_limit before reading unbounded contents.
§

fn save_contents( &self, request: PickRequest, bytes: Vec<u8>, ) -> Receiver<SaveOutcome>

A Save chooser that stores bytes. The default writes to the path pick answers.
§

impl LocationProvider for HostRecorder

§

fn locate(&self) -> Receiver<LocationOutcome>

Request one fix. Answers over the channel, never blocking the caller.
§

impl MediaSessionFactory for HostRecorder

§

fn start( &self, config: MprisConfig, _initial: PlayerSnapshot, ) -> Option<MediaSession>

Register a player described by config, starting from initial. None when the host has no media controls; the player then stays inert.
§

impl MediaSessionPublisher for HostRecorder

§

fn publish(&mut self, snapshot: PlayerSnapshot)

Publish the latest player state. Must not block.
§

impl Notifier for HostRecorder

§

fn show(&self, notification: &Notification) -> Result<(), NotifyError>

Show notification, replacing any earlier one with the same tag. Read more
§

fn withdraw(&self, tag: &str) -> Result<(), NotifyError>

Withdraw the notification shown under tag, if any. Read more
§

fn schedule( &self, notification: &Notification, at: SystemTime, ) -> Result<(), NotifyError>

Have the platform show notification at at, even if this app is no longer running. Scheduling a tag again replaces the earlier one. Read more
§

fn schedule_alarm( &self, notification: &Notification, at: SystemTime, schedule: AlarmSchedule, ) -> Result<(), NotifyError>

Schedule a local-time alarm. Hosts that understand calendar alarms retain recurrence and timezone semantics after the app closes; other hosts retain the supplied next occurrence through schedule. Read more
§

fn alarm_states(&self) -> Result<Vec<AlarmState>, NotifyError>

Calendar handoffs and delivered occurrences owned by this app. Hosts that retain only an absolute deadline return no calendar state. Read more
§

fn scheduled(&self) -> Result<Vec<Scheduled>, NotifyError>

The notifications this app has scheduled that are not yet delivered. Read more
§

fn cancel_scheduled(&self, tag: &str) -> Result<(), NotifyError>

Cancel the scheduled notification under tag, if any. Read more
§

impl ScreenCaptureProvider for HostRecorder

§

fn request( &self, request: ScreenCaptureRequest, ) -> Receiver<ScreenCaptureOutcome>

Ask the user for a screen or window to capture. Answers over the channel, never blocking the caller while the host shows its picker.
§

impl SpeechFactory for HostRecorder

§

fn make(&self) -> Box<dyn Speaker>

A fresh speaker. Must not fail: a host without speech returns a [tts::NullSpeaker].
§

impl UriOpener for HostRecorder

§

fn open(&self, uri: &str) -> Result<(), Error>

Open uri without waiting for the handler to finish. May block until the handler is launched or the request is refused, so the toolkit calls it off the UI thread. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T

§

impl<T> WasmNotSync for T
where T: Sync,