Struct ADBDevices

Source
pub struct ADBDevices { /* private fields */ }
Expand description

List connected devices

Implementations§

Source§

impl ADBDevices

Source

pub fn long(self) -> Self

Examples found in repository?
examples/general/general_info.rs (line 17)
10fn main() {
11    let mut manager = ADBManager::new();
12    match manager.connect("192.168.0.105", 33363) {
13        Ok(()) => println!("Successfully connected"),
14        Err(e) => println!("Could not connect: {}", e),
15    }
16
17    let mut list = ADBDevices::default().long();
18    match manager.execute(&mut list) {
19        Ok(ok) => {
20            println!("{}", ok.to_string());
21
22            let parsed = DeviceInfo::from(ok);
23            println!(
24                "{} {} {}",
25                parsed.product, parsed.model, parsed.transport_id
26            );
27        }
28        Err(err) => println!("Error: {}", err),
29    }
30
31    let mut help = ADBHelp::default();
32    println!("{}", manager.execute(&mut help).unwrap().to_string());
33
34    let mut version = ADBVersion::default();
35    let version = Version::from(manager.execute(&mut version).unwrap());
36    println!(
37        "adb version: {}, version: {}, install: {}",
38        version.adb_version, version.version, version.install_path
39    );
40}

Trait Implementations§

Source§

impl ADBCommand for ADBDevices

Source§

fn build(&mut self) -> Result<&mut Command, String>

Add mandatory parameters to the inner command and return it
Source§

fn process_output(&self, output: ADBResult) -> ADBResult

Remove unnecessary or data that is already known from result
Source§

impl Default for ADBDevices

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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.