Struct Adapter

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

Implementations§

Source§

impl Adapter

Source

pub unsafe fn new( view: *mut c_void, is_view_focused: bool, action_handler: impl 'static + ActionHandler, ) -> Self

Create a new macOS adapter. This function must be called on the main thread.

The action handler will always be called on the main thread.

§Safety

view must be a valid, unreleased pointer to an NSView.

Source

pub fn update_if_active( &mut self, update_factory: impl FnOnce() -> TreeUpdate, ) -> Option<QueuedEvents>

If and only if the tree has been initialized, call the provided function and apply the resulting update. Note: If the caller’s implementation of ActivationHandler::request_initial_tree initially returned None, the TreeUpdate returned by the provided function must contain a full tree.

If a QueuedEvents instance is returned, the caller must call QueuedEvents::raise on it.

Source

pub fn update_view_focus_state( &mut self, is_focused: bool, ) -> Option<QueuedEvents>

Update the tree state based on whether the window is focused.

If a QueuedEvents instance is returned, the caller must call QueuedEvents::raise on it.

Source

pub fn view_children<H: ActivationHandler + ?Sized>( &mut self, activation_handler: &mut H, ) -> *mut NSArray<NSObject>

Source

pub fn focus<H: ActivationHandler + ?Sized>( &mut self, activation_handler: &mut H, ) -> *mut NSObject

Source

pub fn hit_test<H: ActivationHandler + ?Sized>( &mut self, point: NSPoint, activation_handler: &mut H, ) -> *mut NSObject

Trait Implementations§

Source§

impl Debug for Adapter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Adapter

§

impl !RefUnwindSafe for Adapter

§

impl !Send for Adapter

§

impl !Sync for Adapter

§

impl Unpin for Adapter

§

impl !UnwindSafe for Adapter

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> 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 = 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.
Source§

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