pub struct ProvisionerLimits { /* private fields */ }Expand description
What a provisioner identity may grant beyond its fixed route scope.
A budget ceiling and a nonempty approved policy set are mandatory. An identity without either cannot be constructed (#39, #43).
Implementations§
Source§impl ProvisionerLimits
impl ProvisionerLimits
Sourcepub fn new(
max_budget_allowance: CostUnits,
policy_templates: Vec<ProvisionerPolicyTemplate>,
) -> Result<Self, SecurityError>
pub fn new( max_budget_allowance: CostUnits, policy_templates: Vec<ProvisionerPolicyTemplate>, ) -> Result<Self, SecurityError>
Bound the periodic allowance and approve complete snapshot policies.
§Errors
Refuses an empty policy set or a policy that cannot pass snapshot validation. Zero-cost policy is permitted only by explicitly approving it.
Sourcepub fn max_budget_allowance(&self) -> CostUnits
pub fn max_budget_allowance(&self) -> CostUnits
The largest periodic allowance this identity may set, inclusive.
Sourcepub fn allows_snapshot(&self, snapshot: &AccountSnapshot) -> bool
pub fn allows_snapshot(&self, snapshot: &AccountSnapshot) -> bool
Whether one complete approved template matches this strict snapshot. Fields from different templates cannot be mixed into a new policy.
Trait Implementations§
Source§impl Clone for ProvisionerLimits
impl Clone for ProvisionerLimits
Source§impl Debug for ProvisionerLimits
impl Debug for ProvisionerLimits
impl Eq for ProvisionerLimits
Auto Trait Implementations§
impl Freeze for ProvisionerLimits
impl RefUnwindSafe for ProvisionerLimits
impl Send for ProvisionerLimits
impl Sync for ProvisionerLimits
impl Unpin for ProvisionerLimits
impl UnsafeUnpin for ProvisionerLimits
impl UnwindSafe for ProvisionerLimits
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