Struct radb_client::AdbClient

source ·
pub struct AdbClient {
    pub device: Device,
    /* private fields */
}

Fields§

§device: Device

Implementations§

source§

impl AdbClient

source

pub fn try_from_device(device: Device) -> Result<AdbClient, AdbError>

source

pub fn is_connected(&self) -> bool

source

pub fn connect(&self, timeout: Option<Duration>) -> Result<(), AdbError>

Try to connect to the inner device.

Arguments
  • timeout: optional timeout for connecting

returns: Result<(), Error>

Examples
use radb_client::Device;
use radb_client::AdbClient;

pub fn connect() {
 let device: Device = "192.168.1.24:5555".parse().unwrap();
 let client: AdbClient = device.try_into().unwrap();
 client.connect(None).await.unwrap();
}
source

pub fn disconnect(&self) -> Result<bool>

source

pub fn try_disconnect(&self) -> Result<bool>

source

pub fn root(&self) -> Result<bool>

source

pub fn unroot(&self) -> Result<bool>

source

pub fn is_root(&self) -> Result<bool>

source

pub fn remount(&self) -> Result<()>

source

pub fn mount<T: Arg>(&self, dir: T) -> Result<()>

source

pub fn unmount<T: Arg>(&self, dir: T) -> Result<()>

source

pub fn bug_report<T: Arg>(&self, output: Option<T>) -> Result<Output>

source

pub fn disable_verity(&self) -> Result<()>

Root is required

source

pub fn get_mac_address(&self) -> Result<MacAddress>

Root is required

source

pub fn get_wlan_address(&self) -> Result<MacAddress>

Root is required

source

pub fn pull<'s, S, D>(&self, src: S, dst: D) -> Result<Output>
where S: Into<&'s str> + AsRef<OsStr> + Arg, D: AsRef<Path>,

source

pub fn push<'d, S, D>(&self, src: S, dst: D) -> Result<Output>
where D: Into<&'d str> + AsRef<OsStr> + Arg, S: AsRef<Path>,

source

pub fn clear_logcat(&self) -> Result<()>

source

pub fn logcat( &self, options: LogcatOptions, cancel: Option<Receiver<()>> ) -> Result<Output>

source

pub fn api_level(&self) -> Result<String>

source

pub fn version(&self) -> Result<u8>

source

pub fn name(&self) -> Result<Option<String>>

source

pub fn save_screencap(&self, output: File) -> Result<()>

source

pub fn copy_screencap(&self) -> Result<()>

source

pub fn get_boot_id(&self) -> Result<Uuid>

source

pub fn reboot(&self, reboot_type: Option<RebootType>) -> Result<()>

source

pub fn wait_for_device(&self, timeout: Option<Duration>) -> Result<()>

source

pub fn shell(&self) -> AdbShell<'_>

source

pub fn pm(&self) -> PackageManager<'_>

source

pub fn am(&self) -> ActivityManager<'_>

Trait Implementations§

source§

impl Clone for AdbClient

source§

fn clone(&self) -> AdbClient

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AdbClient

source§

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

Formats the value using the given formatter. Read more
source§

impl From<AdbClient> for CommandBuilder

source§

fn from(value: AdbClient) -> Self

Converts to this type from the input type.
source§

impl<'a> Into<AdbShell<'a>> for &'a AdbClient

source§

fn into(self: &'a AdbClient) -> AdbShell<'a>

Converts this type into the (usually inferred) input type.
source§

impl PartialEq for AdbClient

source§

fn eq(&self, other: &AdbClient) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&ClientResult> for AdbClient

§

type Error = AdbError

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

fn try_from(value: &ClientResult) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Device> for AdbClient

§

type Error = AdbError

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

fn try_from(value: Device) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryInto<AdbClient> for ClientResult

§

type Error = AdbError

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

fn try_into(self) -> Result<AdbClient, Self::Error>

Performs the conversion.
source§

impl Eq for AdbClient

source§

impl StructuralEq for AdbClient

source§

impl StructuralPartialEq for AdbClient

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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.