pub struct Scope { /* private fields */ }Expand description
One scope: an identity, a principal, and the grant it was opened under.
Read through super::Session::scope. It holds no balance: the balance
is super::fold_balance over the ledger, decided inside the store for a
reserve and read back from the log for everything else
(super::Session::remaining). A number kept here would be a second
answer to that question, and the wrong one on a stream more than one
handle writes to. What the scope keeps of the grant is its words — the
tag a refusal reports, the desc an audit reads.
Implementations§
Source§impl Scope
impl Scope
Sourcepub fn new(owner: String, grant: Option<BudgetGrant>) -> Self
pub fn new(owner: String, grant: Option<BudgetGrant>) -> Self
Open a scope for owner with an optional grant, under a fresh
kernel-issued id.
Sourcepub fn owner(&self) -> &str
pub fn owner(&self) -> &str
Whose scope this is (a principal id, or super::ANON /
super::SYSTEM).
Sourcepub fn grant(&self) -> Option<&BudgetGrant>
pub fn grant(&self) -> Option<&BudgetGrant>
The grant this scope opened (or resumed) with, if any.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more