pub struct RestrictReq { /* private fields */ }Expand description
Wraps an SDK RestrictRequest where we do additional things like re-use
request access tokens, and map errors appropriately.
Implementations§
Source§impl RestrictReq
impl RestrictReq
pub fn new(ctx: &Ctx) -> Result<Self>
pub fn set_api<S: Into<String>>(&mut self, api: S) -> Result<()>
pub fn set_directory<S: Into<String>>(&mut self, dir: S) -> Result<()>
pub fn set_from_api<S: Into<String>>(&mut self, api: S) -> Result<()>
pub fn set_from_dir<S: Into<String>>(&mut self, dir: S) -> 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 RestrictReq
impl RestrictReq
pub fn get_restriction(&mut self) -> Result<Restriction>
pub fn set_restriction(&mut self, details: RestrictionDetails) -> Result<()>
pub fn delete_restriction(&mut self) -> Result<()>
pub fn get_page(&mut self) -> Result<RestrictionRange>
pub fn get_all_pages(&mut self) -> Result<Vec<Restriction>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RestrictReq
impl !RefUnwindSafe for RestrictReq
impl Send for RestrictReq
impl Sync for RestrictReq
impl Unpin for RestrictReq
impl !UnwindSafe for RestrictReq
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