pub struct MetadataReq { /* private fields */ }Expand description
Wraps an SDK MetadataRequest where we do additional things like re-use request access
tokens, allow changing the Formation this request is pointed to, and map errors appropriately.
Implementations§
Source§impl MetadataReq
impl MetadataReq
pub fn new(ctx: &Ctx) -> Result<Self>
pub fn set_key<S: Into<String>>(&mut self, key: S) -> Result<()>
pub fn set_dir(&mut self, dir: RangeQueryContext<Key>) -> 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.
Source§impl MetadataReq
impl MetadataReq
pub fn get_value(&mut self) -> Result<ValueModel>
pub fn put_value_unencoded<S: AsRef<[u8]>>(&mut self, value: S) -> Result<()>
pub fn put_value(&mut self, value: ValueModel) -> Result<()>
pub fn delete_value(&mut self) -> Result<()>
pub fn get_page(&mut self) -> Result<KeyValueRangeModel>
pub fn get_all_pages(&mut self) -> Result<Vec<KeyValueModel>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MetadataReq
impl !RefUnwindSafe for MetadataReq
impl Send for MetadataReq
impl Sync for MetadataReq
impl Unpin for MetadataReq
impl !UnwindSafe for MetadataReq
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