Struct MaaToolkit

Source
pub struct MaaToolkit;
Available on crate feature toolkit only.

Implementations§

Source§

impl MaaToolkit

Source

pub fn new() -> MaaResult<Self>

👎Deprecated since 0.4.0: Use MaaToolkit::new_with_options instead

Initialize the MaaToolkit

§Errors

Returns an error if the toolkit initialization fails

Source

pub fn new_with_options<T: Serialize>( user_path: String, config: T, ) -> MaaResult<Self>

Source

pub fn find_adb_device(&self) -> MaaResult<Vec<AdbDeviceInfo>>

Available on crate feature adb only.

Find all the devices

§Errors

Return an error if fails to convert MaaStringView to String

Source

pub fn find_adb_device_with_adb( &self, adb_path: &str, ) -> MaaResult<Vec<AdbDeviceInfo>>

Available on crate feature adb only.

Find all the devices with a given adb path

§Errors

Return an error if fails to convert MaaStringView to String

Source

pub fn register_custom_recognizer_executor<T>( &self, handle: MaaInstance<T>, recognizer_name: &str, recognizer_exec_path: &str, recognizer_exec_params: Vec<String>, ) -> MaaResult<()>

Source

pub fn unregister_custom_recognizer_executor<T>( &self, handle: MaaInstance<T>, recognizer_name: &str, ) -> MaaResult<()>

Source

pub fn register_custom_action_executor<T>( &self, handle: MaaInstance<T>, action_name: &str, action_exec_path: &str, action_exec_params: Vec<String>, ) -> MaaResult<()>

Source

pub fn unregister_custom_action_executor<T>( &self, handle: MaaInstance<T>, action_name: &str, ) -> MaaResult<()>

Source

pub fn find_win32_window( &self, class_name: &str, window_name: &str, find: bool, ) -> Vec<MaaWin32Hwnd>

Available on crate feature win32 only.

Find all the windows with a given class name and window name

§Parameters
  • class_name: The class name of the window
  • window_name: The window name of the window
  • find: If true, find the window using system win32 api, otherwise search the window with text match
Source

pub fn get_cursor_window(&self) -> MaaWin32Hwnd

Available on crate feature win32 only.
Source

pub fn get_desktop_window(&self) -> MaaWin32Hwnd

Available on crate feature win32 only.
Source

pub fn get_foreground_window(&self) -> MaaWin32Hwnd

Available on crate feature win32 only.
Source

pub fn list_windows(&self) -> Vec<MaaWin32Hwnd>

Available on crate feature win32 only.

Trait Implementations§

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