pub struct CloudClient { /* private fields */ }Expand description
Client of the Redseat cloud. Cheap to clone.
Implementations§
Source§impl CloudClient
impl CloudClient
Sourcepub fn new(transport: Arc<dyn Transport>) -> Self
pub fn new(transport: Arc<dyn Transport>) -> Self
A client that reaches the cloud through transport, whose base URL is the cloud.
Sourcepub fn http() -> Result<Self>
pub fn http() -> Result<Self>
A client of DEFAULT_CLOUD_URL over HTTP.
Sourcepub fn http_with_url(base_url: &str) -> Result<Self>
pub fn http_with_url(base_url: &str) -> Result<Self>
A client of the cloud at base_url over HTTP.
Sourcepub async fn sign_in_with_google_id_token(
&self,
id_token: &str,
) -> Result<CloudSession>
pub async fn sign_in_with_google_id_token( &self, id_token: &str, ) -> Result<CloudSession>
Exchanges a Google ID token for a cloud session. The token’s audience must be one of the cloud’s Google clients (web, TV or desktop).
Sourcepub async fn get_session(&self, token: &str) -> Result<Option<CloudSession>>
pub async fn get_session(&self, token: &str) -> Result<Option<CloudSession>>
The session of token, extended by the cloud when it is more than a day old.
None when the session expired or was revoked.
Sourcepub async fn list_servers(
&self,
session_token: &str,
) -> Result<Vec<CloudServer>>
pub async fn list_servers( &self, session_token: &str, ) -> Result<Vec<CloudServer>>
The servers of the user: owned, shared, and only saved.
Sourcepub async fn get_server(
&self,
server_id: &str,
session_token: &str,
) -> Result<CloudServer>
pub async fn get_server( &self, server_id: &str, session_token: &str, ) -> Result<CloudServer>
One server.
Sourcepub async fn fetch_server_token(
&self,
server_id: &str,
session_token: &str,
) -> Result<ServerToken>
pub async fn fetch_server_token( &self, server_id: &str, session_token: &str, ) -> Result<ServerToken>
A token for server_id, to send to that server as Authorization: Bearer.
Trait Implementations§
Source§impl Clone for CloudClient
impl Clone for CloudClient
Auto Trait Implementations§
impl !RefUnwindSafe for CloudClient
impl !UnwindSafe for CloudClient
impl Forget for CloudClient
impl Freeze for CloudClient
impl Move for CloudClient
impl Send for CloudClient
impl Sync for CloudClient
impl Unpin for CloudClient
impl UnsafeUnpin for CloudClientwhere
*const ArcInner<dyn Transport> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Transport>>: UnsafeUnpin,
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