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§
Source§impl 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 Freeze for LocksReq
impl !RefUnwindSafe for LocksReq
impl Send for LocksReq
impl Sync for LocksReq
impl Unpin for LocksReq
impl !UnwindSafe for LocksReq
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