pub struct AppKitServices { /* private fields */ }Trait Implementations§
Source§impl Drop for AppKitServices
impl Drop for AppKitServices
Source§impl Services for AppKitServices
impl Services for AppKitServices
Source§fn trash(
&mut self,
_parent: Option<NodeId>,
paths: &[PathBuf],
reply: Reply<Result<(), ServiceError>>,
)
fn trash( &mut self, _parent: Option<NodeId>, paths: &[PathBuf], reply: Reply<Result<(), ServiceError>>, )
NSFileManager trashes synchronously, so on a queue of its own, as
Finder does: within a disk it’s a move, but each item on a network
disk is a round trip to the server, which would stall the window.
Source§fn launch(
&mut self,
_parent: Option<NodeId>,
target: &Launch,
reply: Reply<Result<(), ServiceError>>,
)
fn launch( &mut self, _parent: Option<NodeId>, target: &Launch, reply: Reply<Result<(), ServiceError>>, )
NSWorkspace opens it as Finder would, asking which app (or
saying there’s none) itself when no app is set.
Source§fn window_destroyed(&mut self, window: NodeId)
fn window_destroyed(&mut self, window: NodeId)
Each sheet on the window ends with its cancel response, as Escape would end it, while the window is still there to end it on.
Source§fn clipboard_text(&mut self, reply: Reply<Option<String>>)
fn clipboard_text(&mut self, reply: Reply<Option<String>>)
Reads the clipboard’s text. Async because GTK and WinUI only read the
clipboard asynchronously; platforms that can may reply right away.
Source§fn set_clipboard_text(
&mut self,
text: &str,
reply: Reply<Result<(), ServiceError>>,
)
fn set_clipboard_text( &mut self, text: &str, reply: Reply<Result<(), ServiceError>>, )
Writes the clipboard (it can fail: e.g. another process holds it).
Source§fn alert(&mut self, parent: Option<NodeId>, alert: &Alert, reply: Reply<usize>)
fn alert(&mut self, parent: Option<NodeId>, alert: &Alert, reply: Reply<usize>)
Shows an alert, attached to
parent if given (a sheet on macOS) or
to the active window. Must not block: reply when the user answers.Source§fn open_file(
&mut self,
parent: Option<NodeId>,
request: &OpenFile,
reply: Reply<Option<Vec<PathBuf>>>,
)
fn open_file( &mut self, parent: Option<NodeId>, request: &OpenFile, reply: Reply<Option<Vec<PathBuf>>>, )
Replies with the chosen paths, or
None if cancelled.fn save_file( &mut self, parent: Option<NodeId>, request: &SaveFile, reply: Reply<Option<PathBuf>>, )
Source§fn notify(
&mut self,
notification: &Notification,
activated: Rc<dyn Fn(String)>,
reply: Reply<Result<(), ServiceError>>,
)
fn notify( &mut self, notification: &Notification, activated: Rc<dyn Fn(String)>, reply: Reply<Result<(), ServiceError>>, )
Shows a notification outside the app’s windows, as the platform
shows its apps’, replacing the one with the same id
(
notification.id is always set). Replies once the platform has it:
Cancelled if the user turned the app’s notifications off or said
no when the platform asked, Unavailable if there’s nothing to show
it (no notification server, a macOS app outside a bundle). When the
user clicks it, the platform brings the app forward, as it does for
its own apps, and the backend calls activated with its id.Source§fn withdraw_notification(&mut self, id: &str)
fn withdraw_notification(&mut self, id: &str)
Takes the notification with this id away, from the screen and the
platform’s list. Nothing happens if there’s none.
Installs a menu bar: the app’s (
window is None), or one
window’s own menus, which it shows with the app’s
(MenuBarData::merged). Called again whenever the bar changes;
an empty bar removes a window’s menus. A window’s menus may arrive
before the window is created, and after it’s destroyed. Read moreSource§fn set_tray(
&mut self,
tray: Option<&TrayData>,
activate: Rc<dyn Fn(u32)>,
shown: Rc<dyn Fn(bool)>,
)
fn set_tray( &mut self, tray: Option<&TrayData>, activate: Rc<dyn Fn(u32)>, shown: Rc<dyn Fn(bool)>, )
Shows the app’s icon in the platform’s tray, or takes it away
(
None). Called again whenever it changes. A click opens its menu
(there’s no other click), and the backend calls activate with
the id of the item chosen. Call shown whenever whether it’s
showing changes: on Linux the tray’s host can come and go, and
plain GNOME has none. A platform without a tray keeps the default,
which shows nothing.Auto Trait Implementations§
impl !RefUnwindSafe for AppKitServices
impl !Send for AppKitServices
impl !Sync for AppKitServices
impl !UnwindSafe for AppKitServices
impl Forget for AppKitServices
impl Freeze for AppKitServices
impl Move for AppKitServices
impl Unpin for AppKitServices
impl UnsafeUnpin for AppKitServices
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
Mutably borrows from an owned value. Read more