pub struct ADBServerDevice {
pub identifier: String,
/* private fields */
}Expand description
Represents a device connected to the ADB server.
Fields§
§identifier: StringUnique device identifier.
Implementations§
Source§impl ADBServerDevice
impl ADBServerDevice
Sourcepub fn new(identifier: String, socket_addr: Option<SocketAddrV4>) -> Self
pub fn new(identifier: String, socket_addr: Option<SocketAddrV4>) -> Self
Instantiates a new ADBServerDevice
Source§impl ADBServerDevice
impl ADBServerDevice
Sourcepub fn host_features(&mut self) -> Result<Vec<HostFeatures>>
pub fn host_features(&mut self) -> Result<Vec<HostFeatures>>
Lists available ADB server features.
Source§impl ADBServerDevice
impl ADBServerDevice
Sourcepub fn reboot(&mut self, reboot_type: RebootType) -> Result<()>
pub fn reboot(&mut self, reboot_type: RebootType) -> Result<()>
Reboots the device
Source§impl ADBServerDevice
impl ADBServerDevice
Sourcepub fn transport_any(&mut self) -> Result<()>
pub fn transport_any(&mut self) -> Result<()>
Asks ADB server to switch the connection to either the device or emulator connect to/running on the host. Will fail if there is more than one such device/emulator available.
Trait Implementations§
Source§impl ADBDeviceExt for ADBServerDevice
impl ADBDeviceExt for ADBServerDevice
Source§fn shell_command(
&mut self,
command: &[&str],
output: &mut dyn Write,
) -> Result<()>
fn shell_command( &mut self, command: &[&str], output: &mut dyn Write, ) -> Result<()>
Runs command in a shell on the device, and write its output and error streams into output.
Source§fn stat(&mut self, remote_path: &str) -> Result<AdbStatResponse>
fn stat(&mut self, remote_path: &str) -> Result<AdbStatResponse>
Display the stat information for a remote file
Source§fn shell(
&mut self,
reader: &mut dyn Read,
writer: Box<dyn Write + Send>,
) -> Result<()>
fn shell( &mut self, reader: &mut dyn Read, writer: Box<dyn Write + Send>, ) -> Result<()>
Starts an interactive shell session on the device.
Input data is read from reader and write to writer.
Source§fn pull(
&mut self,
source: &dyn AsRef<str>,
output: &mut dyn Write,
) -> Result<()>
fn pull( &mut self, source: &dyn AsRef<str>, output: &mut dyn Write, ) -> Result<()>
Pull the remote file pointed to by
source and write its contents into outputSource§fn reboot(&mut self, reboot_type: RebootType) -> Result<()>
fn reboot(&mut self, reboot_type: RebootType) -> Result<()>
Reboot the device using given reboot type
Source§fn push(&mut self, stream: &mut dyn Read, path: &dyn AsRef<str>) -> Result<()>
fn push(&mut self, stream: &mut dyn Read, path: &dyn AsRef<str>) -> Result<()>
Push
stream to path on the device.Source§fn install(&mut self, apk_path: &dyn AsRef<Path>) -> Result<()>
fn install(&mut self, apk_path: &dyn AsRef<Path>) -> Result<()>
Install an APK pointed to by
apk_path on device.Source§fn uninstall(&mut self, package: &str) -> Result<()>
fn uninstall(&mut self, package: &str) -> Result<()>
Uninstall the package
package from device.Source§fn framebuffer_inner(&mut self) -> Result<ImageBuffer<Rgba<u8>, Vec<u8>>>
fn framebuffer_inner(&mut self) -> Result<ImageBuffer<Rgba<u8>, Vec<u8>>>
Inner method requesting framebuffer from an Android device
Source§fn run_activity(&mut self, package: &str, activity: &str) -> Result<Vec<u8>>
fn run_activity(&mut self, package: &str, activity: &str) -> Result<Vec<u8>>
Run
activity from package on device. Return the command output.Source§fn framebuffer(&mut self, path: &dyn AsRef<Path>) -> Result<()>
fn framebuffer(&mut self, path: &dyn AsRef<Path>) -> Result<()>
Dump framebuffer of this device into given path
Source§impl Debug for ADBServerDevice
impl Debug for ADBServerDevice
Source§impl Drop for ADBServerDevice
impl Drop for ADBServerDevice
Source§impl TryFrom<ADBServerDevice> for ADBEmulatorDevice
impl TryFrom<ADBServerDevice> for ADBEmulatorDevice
Source§type Error = RustADBError
type Error = RustADBError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ADBServerDevice
impl RefUnwindSafe for ADBServerDevice
impl Send for ADBServerDevice
impl Sync for ADBServerDevice
impl Unpin for ADBServerDevice
impl UnwindSafe for ADBServerDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more