pub struct ProcessServices {
pub clipboard: Arc<dyn ClipboardBackend>,
pub files: Arc<dyn FilePicker>,
pub opener: Arc<dyn UriOpener>,
pub speech: Arc<dyn SpeechFactory>,
pub notifications: Arc<dyn Notifier>,
pub media_session: Arc<dyn MediaSessionFactory>,
pub location: Arc<dyn LocationProvider>,
pub screen_capture: Arc<dyn ScreenCaptureProvider>,
pub secrets: Arc<dyn SecretsProvider>,
}Expand description
Everything a ui process may ask of its process.
Cheap to clone: each service is shared.
Fields§
§clipboard: Arc<dyn ClipboardBackend>§files: Arc<dyn FilePicker>§opener: Arc<dyn UriOpener>§speech: Arc<dyn SpeechFactory>§notifications: Arc<dyn Notifier>§media_session: Arc<dyn MediaSessionFactory>§location: Arc<dyn LocationProvider>§screen_capture: Arc<dyn ScreenCaptureProvider>§secrets: Arc<dyn SecretsProvider>Implementations§
Source§impl ProcessServices
impl ProcessServices
Sourcepub fn recording() -> (Self, ProcessRecorder)
pub fn recording() -> (Self, ProcessRecorder)
Services that record every effect in the returned ProcessRecorder.
Source§impl ProcessServices
impl ProcessServices
Sourcepub fn null() -> Self
pub fn null() -> Self
Services that never leave the process: an in-process clipboard, file choosers that fail, no URI handler, silent speech, no notifications, no media controls, no location, no screen capture, and secrets kept in the process.
Sourcepub fn system(app_id: Option<&str>) -> Self
pub fn system(app_id: Option<&str>) -> Self
This target’s services for the app app_id: the clipboard over the connection its
session serves it, each platform crate’s system backend (file choosers and URI opening,
notifications, secrets) and, with the native feature, speech, media controls and screen
capture. Location is the device’s own action, which the host installs with
Self::with_location; a process given none answers that location is not available.
Without an app id notifications are unavailable.
Sourcepub fn with_clipboard(self, clipboard: Arc<dyn ClipboardBackend>) -> Self
pub fn with_clipboard(self, clipboard: Arc<dyn ClipboardBackend>) -> Self
Replace the clipboard, keeping every other service.
Sourcepub fn with_files(self, files: Arc<dyn FilePicker>) -> Self
pub fn with_files(self, files: Arc<dyn FilePicker>) -> Self
Replace file choosing and opening, keeping every other service.
Sourcepub fn with_location(self, location: Arc<dyn LocationProvider>) -> Self
pub fn with_location(self, location: Arc<dyn LocationProvider>) -> Self
Replace location, keeping every other service: the host installs one that asks the device’s own action, so a sandboxed process never reaches the platform’s location service itself.
Trait Implementations§
Source§impl Clone for ProcessServices
impl Clone for ProcessServices
Auto Trait Implementations§
impl !RefUnwindSafe for ProcessServices
impl !UnwindSafe for ProcessServices
impl Forget for ProcessServices
impl Freeze for ProcessServices
impl Move for ProcessServices
impl Send for ProcessServices
impl Sync for ProcessServices
impl Unpin for ProcessServices
impl UnsafeUnpin for ProcessServices
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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