Struct remoteit_api::R3Client

source ·
pub struct R3Client { /* private fields */ }
Expand description

A client for the remote.it API.

§Example

You can instantiate a new R3Client using the builder pattern:


let credentials = Credentials::load_from_disk().call().unwrap().take_profile("default").unwrap().unwrap();
let client = R3Client::builder().credentials(credentials).build();
// Start making API calls
let devices = client.get_devices().call().unwrap();

Implementations§

source§

impl R3Client

source

pub async fn send_remoteit_graphql_request_async<V: Serialize, R: for<'a> Deserialize<'a>>( self, query_body: &QueryBody<V>, ) -> Result<Response<R>, Box<dyn Error>>

Sends a signed GraphQL request to the remote.it API in a blocking way.

You probably don’t want to use this function directly, but rather use the other functions in this module like R3Client::get_files().

§Errors
  • Any error that occurs during the request.
  • Any error that occurs during deserialization of the response.
source

pub fn get_files_async(self) -> R3ClientGetFilesAsyncBuilder

Get a list of files that were uploaded to remote.it.

source

pub fn delete_file_async(self) -> R3ClientDeleteFileAsyncBuilder

Delete a file from remote.it. Deletes all versions of the file.

source

pub fn delete_file_version_async(self) -> R3ClientDeleteFileVersionAsyncBuilder

Delete a version of a file from remote.it. (Not the whole file)

source

pub fn start_job_async(self) -> R3ClientStartJobAsyncBuilder

Start scripting jobs on one or more devices.

source

pub fn cancel_job_async(self) -> R3ClientCancelJobAsyncBuilder

Cancel a job. See remote.it docs on more information on when jobs can be cancelled.

source

pub fn get_jobs_async(self) -> R3ClientGetJobsAsyncBuilder

Get a list of jobs that were started on remote.it.

source

pub fn get_application_types_async( self, ) -> R3ClientGetApplicationTypesAsyncBuilder

Get a list of application types that are available on remote.it.

source

pub fn get_devices_async(self) -> R3ClientGetDevicesAsyncBuilder

Get a list of devices.

source§

impl R3Client

Impl block for blocking API calls.

source

pub fn send_remoteit_graphql_request<V: Serialize, R: for<'a> Deserialize<'a>>( self, query_body: &QueryBody<V>, ) -> Result<Response<R>, Box<dyn Error>>

Sends a signed GraphQL request to the remote.it API in a blocking way.

You probably don’t want to use this function directly, but rather use the other functions in this module like R3Client::get_files().

§Errors
  • Any error that occurs during the request.
  • Any error that occurs during deserialization of the response.
source

pub fn get_files(self) -> R3ClientGetFilesBuilder

Get a list of files that were uploaded to remote.it.

source

pub fn delete_file(self) -> R3ClientDeleteFileBuilder

Delete a file from remote.it. Deletes all versions of the file.

source

pub fn delete_file_version(self) -> R3ClientDeleteFileVersionBuilder

Delete a version of a file from remote.it. (Not the whole file)

source

pub fn start_job(self) -> R3ClientStartJobBuilder

Start scripting jobs on one or more devices.

source

pub fn cancel_job(self) -> R3ClientCancelJobBuilder

Cancel a job. See remote.it docs on more information on when jobs can be cancelled.

source

pub fn get_jobs(self) -> R3ClientGetJobsBuilder

Get a list of jobs that were started on remote.it.

source

pub fn get_application_types(self) -> R3ClientGetApplicationTypesBuilder

Get a list of application types that are available on remote.it.

source

pub fn get_devices(self) -> R3ClientGetDevicesBuilder

Get a list of devices.

source§

impl R3Client

source

pub fn builder() -> R3ClientBuilder

Use builder syntax to create an instance of R3Client

source§

impl R3Client

source

pub fn credentials(&self) -> &Credentials

§Returns

A reference to the credentials used by the client.

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more