pub(crate) fn allocation_before_execution(
        &mut self,
        canister: &CanisterState,
    ) -> QueryAllocation {
        let allocation_used = match self.allocations.get(&canister.canister_id()) {
            None => QueryAllocation::zero(),
            Some(allocation) => *allocation,
        };
        QueryAllocation::default() - allocation_used
    }
/// Based on the query allocation of the canister and how much of it has
/// already been consumed in the current interval, returns the amount of
/// allocation that is still available for executing.
Based on the query allocation of the canister and how much of it has
already been consumed in the current interval, returns the amount of
allocation that is still available for executing.
Based on the query allocation of the canister and how much of it has already been consumed in the current interval returns the amount of allocation that is still available for executing .
pub(crate) fn allocation_before_execution(
        &mut self,
        canister: &CanisterState,
    ) -> QueryAllocation {
        let allocation_used = match self.allocations.get(&canister.canister_id()) {
            None => QueryAllocation::zero(),
            Some(allocation) => *allocation,
        };
        QueryAllocation::default() - allocation_used
    }
pub ( crate ) fn allocation_before_execution ( & mut self , canister : & CanisterState , ) -> QueryAllocation { let allocation_used = match self . allocations . get ( & canister . canister_id ( ) ) { None => QueryAllocation :: zero ( ) , Some ( allocation ) => * allocation , } ; QueryAllocation :: default ( ) - allocation_used }
Based on the query allocation of the canister and how much of it has
already been consumed in the current interval, returns the amount of
allocation that is still available for executing.
Based on the query allocation of the canister and how much of it has already been consumed in the current interval returns the amount of allocation that is still available for executing .
&mut self
canister
&CanisterState
&mut self
canister
&CanisterState