Struct seaplane_cli::api::LocksReq
source · [−]pub struct LocksReq { /* private fields */ }Expand description
Wraps an SDK LocksRequest where we do additional things like re-use request access
tokens, allow changing the Locks this request is pointed to, and map errors appropriately.
Implementations
sourceimpl LocksReq
impl LocksReq
pub fn new(ctx: &Ctx) -> Result<Self>
pub fn set_identifiers<S: Into<String>>(
&mut self,
name: Option<LockName>,
lock_id: Option<S>
) -> Result<()>
pub fn set_name(&mut self, name: LockName) -> Result<()>
sourcepub fn refresh_token(&mut self) -> Result<()>
pub fn refresh_token(&mut self) -> Result<()>
Request a new Access Token
sourcepub fn token_or_refresh(&mut self) -> Result<&str>
pub fn token_or_refresh(&mut self) -> Result<&str>
Retrieves the JWT access token, requesting a new one if required.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for LocksReq
impl Send for LocksReq
impl Sync for LocksReq
impl Unpin for LocksReq
impl !UnwindSafe for LocksReq
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more