Struct HostServices
pub struct HostServices {
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 host.
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§
§impl HostServices
impl HostServices
pub fn recording() -> (HostServices, HostRecorder)
pub fn recording() -> (HostServices, HostRecorder)
Services that record every effect in the returned HostRecorder.
§impl HostServices
impl HostServices
pub fn null() -> HostServices
pub fn null() -> HostServices
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.
pub fn system(app_id: Option<&str>) -> HostServices
pub fn system(app_id: Option<&str>) -> HostServices
This target’s services for the app app_id: each platform crate’s
system backend (clipboard, file choosers and URI opening,
notifications, location, secrets) and, with the native feature, speech, media
controls and screen capture. Without an app id notifications are
unavailable.
pub fn with_clipboard(
self,
clipboard: Arc<dyn ClipboardBackend>,
) -> HostServices
pub fn with_clipboard( self, clipboard: Arc<dyn ClipboardBackend>, ) -> HostServices
Replace the clipboard, keeping every other service.
pub fn with_files(self, files: Arc<dyn FilePicker>) -> HostServices
pub fn with_files(self, files: Arc<dyn FilePicker>) -> HostServices
Replace file choosing and opening, keeping every other service.
Trait Implementations§
§impl Clone for HostServices
impl Clone for HostServices
§fn clone(&self) -> HostServices
fn clone(&self) -> HostServices
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HostServices
impl !RefUnwindSafe for HostServices
impl Send for HostServices
impl Sync for HostServices
impl Unpin for HostServices
impl UnsafeUnpin for HostServices
impl !UnwindSafe for HostServices
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,
§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