pub struct Allocation {
pub amount: i64,
pub tag: Option<String>,
}Expand description
What a parent hands to a child: an amount out of its own balance, and optionally the unit the child’s ledger names it by.
Not a BudgetGrant, and the difference is where the units come from. A
grant is an owner allowing — it raises a balance out of nothing the
kernel can see, and only an owner may write one. An allocation moves
units that already exist: the parent’s balance falls by exactly what the
child’s rises by, in one transaction (super::Session::open_child), so
no total is created and none is lost.
There is no desc. What an allocation is for is a supervisor’s
vocabulary, and the two events it writes already say the whole of what the
kernel knows: which parent, which child, how much.
tag defaults to the parent’s — the units come out of that ledger, so
they are counted in that unit unless the caller renames them for the
child.
Fields§
§amount: i64How much of the parent’s balance to move. Non-negative.
tag: Option<String>The unit the child’s ledger names, or the parent’s when absent.
Implementations§
Trait Implementations§
Source§impl Clone for Allocation
impl Clone for Allocation
Source§fn clone(&self) -> Allocation
fn clone(&self) -> Allocation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Allocation
impl Debug for Allocation
impl Eq for Allocation
Source§impl PartialEq for Allocation
impl PartialEq for Allocation
impl StructuralPartialEq for Allocation
Auto Trait Implementations§
impl Freeze for Allocation
impl RefUnwindSafe for Allocation
impl Send for Allocation
impl Sync for Allocation
impl Unpin for Allocation
impl UnsafeUnpin for Allocation
impl UnwindSafe for Allocation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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