#[non_exhaustive]pub struct GrantOffer {
pub scope: GrantScope,
pub max: GrantLifetime,
}Expand description
What a tool lets the owner grant on a card: the scope an approval
covers and the longest it may last. The card offers no button beyond
max, and an answer beyond it is capped to it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.scope: GrantScope§max: GrantLifetimeImplementations§
Source§impl GrantOffer
impl GrantOffer
pub fn new(scope: GrantScope, max: GrantLifetime) -> GrantOffer
Sourcepub fn exact_call_once() -> GrantOffer
pub fn exact_call_once() -> GrantOffer
This one call, once: the card offers Allow once only.
Sourcepub fn once(scope: GrantScope) -> GrantOffer
pub fn once(scope: GrantScope) -> GrantOffer
scope for at most this call.
Sourcepub fn session(scope: GrantScope) -> GrantOffer
pub fn session(scope: GrantScope) -> GrantOffer
scope for at most the rest of the session.
Sourcepub fn cap(&self, asked: GrantLifetime) -> GrantLifetime
pub fn cap(&self, asked: GrantLifetime) -> GrantLifetime
The lifetime an answer of asked gets under this offer.
Trait Implementations§
Source§impl Clone for GrantOffer
impl Clone for GrantOffer
Source§fn clone(&self) -> GrantOffer
fn clone(&self) -> GrantOffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GrantOffer
impl Debug for GrantOffer
impl Eq for GrantOffer
Source§impl PartialEq for GrantOffer
impl PartialEq for GrantOffer
impl StructuralPartialEq for GrantOffer
Auto Trait Implementations§
impl Forget for GrantOffer
impl Freeze for GrantOffer
impl Move for GrantOffer
impl RefUnwindSafe for GrantOffer
impl Send for GrantOfferwhere
RawVecInner: Send,
impl Sync for GrantOfferwhere
RawVecInner: Sync,
impl Unpin for GrantOffer
impl UnsafeUnpin for GrantOffer
impl UnwindSafe for GrantOfferwhere
RawVecInner: UnwindSafe,
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