pub struct CliSession { /* private fields */ }Expand description
The session the origin CLI stored at its last login, renewed from its
refresh token when its access token has expired. The renewed session
stays in memory: the CLI’s file is never written.
Implementations§
Source§impl CliSession
impl CliSession
Sourcepub fn load() -> Result<Option<Self>, Error>
pub fn load() -> Result<Option<Self>, Error>
The session the CLI stored, or None when it stored none: under
$XDG_DATA_HOME, or ~/.local/share, on every platform, at
origincloud/session.json.
Sourcepub fn load_from(path: impl Into<PathBuf>) -> Result<Option<Self>, Error>
pub fn load_from(path: impl Into<PathBuf>) -> Result<Option<Self>, Error>
The session stored at path, or None when there is no file.
Sourcepub fn with_token_url(self, url: impl Into<String>) -> Self
pub fn with_token_url(self, url: impl Into<String>) -> Self
Renews the session at url instead of TOKEN_URL.
Sourcepub fn with_http_client(self, http: Client) -> Self
pub fn with_http_client(self, http: Client) -> Self
Sends the renewals with http, instead of the client all
credentials share. Each renewal is bounded by 30 seconds either way.
Trait Implementations§
Source§impl Credentials for CliSession
impl Credentials for CliSession
Source§fn token(&self) -> TokenFuture<'_>
fn token(&self) -> TokenFuture<'_>
A valid access token.
Auto Trait Implementations§
impl !Freeze for CliSession
impl !RefUnwindSafe for CliSession
impl !UnwindSafe for CliSession
impl Send for CliSession
impl Sync for CliSession
impl Unpin for CliSession
impl UnsafeUnpin for CliSession
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