pub struct DirectAccessService { /* private fields */ }
Expand description
Implements a client for the Device Streaming API.
§Example
let client = DirectAccessService::builder().build().await?;
// use `client` to make requests to the Device Streaming API.
§Service Description
A service for allocating Android devices and interacting with the live-allocated devices.
Each Session will wait for available capacity, at a higher priority over Test Execution. When allocated, the session will be exposed through a stream for integration.
DirectAccessService is currently available as a preview to select developers. You can register today on behalf of you and your team at https://developer.android.com/studio/preview/android-device-streaming
§Configuration
To configure DirectAccessService
use the with_*
methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://devicestreaming.googleapis.com
). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
DirectAccessService
holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap DirectAccessService
in
an Rc or Arc to reuse it, because it
already uses an Arc
internally.
Implementations§
Source§impl DirectAccessService
impl DirectAccessService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for DirectAccessService.
let client = DirectAccessService::builder().build().await?;
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: DirectAccessService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: DirectAccessService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_device_session(&self) -> CreateDeviceSession
pub fn create_device_session(&self) -> CreateDeviceSession
Creates a DeviceSession.
Sourcepub fn list_device_sessions(&self) -> ListDeviceSessions
pub fn list_device_sessions(&self) -> ListDeviceSessions
Lists DeviceSessions owned by the project user.
Sourcepub fn get_device_session(&self) -> GetDeviceSession
pub fn get_device_session(&self) -> GetDeviceSession
Gets a DeviceSession, which documents the allocation status and whether the device is allocated. Clients making requests from this API must poll GetDeviceSession.
Sourcepub fn cancel_device_session(&self) -> CancelDeviceSession
pub fn cancel_device_session(&self) -> CancelDeviceSession
Cancel a DeviceSession. This RPC changes the DeviceSession to state FINISHED and terminates all connections. Canceled sessions are not deleted and can be retrieved or listed by the user until they expire based on the 28 day deletion policy.
Sourcepub fn update_device_session(&self) -> UpdateDeviceSession
pub fn update_device_session(&self) -> UpdateDeviceSession
Updates the current DeviceSession to the fields described by the update_mask.
Trait Implementations§
Source§impl Clone for DirectAccessService
impl Clone for DirectAccessService
Source§fn clone(&self) -> DirectAccessService
fn clone(&self) -> DirectAccessService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more