Struct MaaControllerInstance

Source
pub struct MaaControllerInstance<T> { /* private fields */ }
Expand description

A handle to a controller instance

§Note

See MaaInstance for lifetime hints.

Implementations§

Source§

impl<T> MaaControllerInstance<T>

Source

pub fn new_adb( adb_path: &str, address: &str, controller_type: MaaAdbControllerType, config: &str, agent_path: &str, handler: Option<T>, ) -> Self
where T: CallbackHandler,

Available on crate feature adb only.

Create a new AdbController

§Notes

This directly calls MaaAdbControllerCreateV2 since MaaAdbControllerCreate is deprecated

Source

pub fn new_win32( hwnd: MaaWin32Hwnd, controller_type: MaaWin32ControllerType, handler: Option<T>, ) -> Self
where T: CallbackHandler,

Available on crate feature win32 only.
Source

pub fn new_dbg( read_path: &str, write_path: &str, controller_type: MaaDbgControllerType, config: &str, handler: Option<T>, ) -> Self
where T: CallbackHandler,

Available on crate feature dbg only.
Source

pub fn new_custom<C>(controller: C, handler: Option<T>) -> Self

Available on crate feature custom_controller only.
Source

pub fn set_controller_option( &self, option: MaaControllerOption, ) -> MaaResult<()>

Source

pub fn post_connect(&self) -> MaaCtrlId

Source

pub fn post_click(&self, x: i32, y: i32) -> MaaCtrlId

Source

pub fn post_swipe( &self, x1: i32, y1: i32, x2: i32, y2: i32, duration: i32, ) -> MaaCtrlId

Source

pub fn post_press_key(&self, keycode: i32) -> MaaCtrlId

Source

pub fn post_input_text(&self, text: &str) -> MaaCtrlId

Source

pub fn post_touch_down( &self, contact: i32, x: i32, y: i32, pressure: i32, ) -> MaaCtrlId

Source

pub fn post_touch_move( &self, contact: i32, x: i32, y: i32, pressure: i32, ) -> MaaCtrlId

Source

pub fn post_touch_up(&self, contact: i32) -> MaaCtrlId

Source

pub fn post_screencap(&self) -> MaaCtrlId

Source

pub fn status(&self, id: MaaCtrlId) -> MaaResult<MaaStatus>

Source

pub fn wait(&self, id: MaaCtrlId) -> MaaResult<MaaStatus>

Source

pub fn connected(&self) -> bool

Trait Implementations§

Source§

impl<T> Deref for MaaControllerInstance<T>

Source§

type Target = *mut MaaControllerAPI

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T> Drop for MaaControllerInstance<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> Send for MaaControllerInstance<T>

Source§

impl<T> Sync for MaaControllerInstance<T>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.