Skip to main content

AppKitServices

Struct AppKitServices 

Source
pub struct AppKitServices { /* private fields */ }

Trait Implementations§

Source§

impl Drop for AppKitServices

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Services for AppKitServices

Source§

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

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)

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

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

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

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

Replies with the chosen paths, or None if cancelled.
Source§

fn save_file( &mut self, parent: Option<NodeId>, request: &SaveFile, reply: Reply<Option<PathBuf>>, )

Source§

fn set_menu( &mut self, window: Option<NodeId>, menu: &MenuBarData, activate: Rc<dyn Fn(u32)>, )

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 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> AutoreleaseSafe for T
where T: ?Sized,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.