pub struct CyclesAccounting<ChargingPolicy> { /* private fields */ }Expand description
A middleware to handle cycles accounting, i.e. verify if sufficiently many cycles are available in a request.
The cost of sending the request is calculated by ic_cdk_management_canister::cost_http_request.
Implementations§
Source§impl<ChargingPolicy> CyclesAccounting<ChargingPolicy>
impl<ChargingPolicy> CyclesAccounting<ChargingPolicy>
Trait Implementations§
Source§impl<ChargingPolicy: Clone> Clone for CyclesAccounting<ChargingPolicy>
impl<ChargingPolicy: Clone> Clone for CyclesAccounting<ChargingPolicy>
Source§fn clone(&self) -> CyclesAccounting<ChargingPolicy>
fn clone(&self) -> CyclesAccounting<ChargingPolicy>
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<ChargingPolicy: Debug> Debug for CyclesAccounting<ChargingPolicy>
impl<ChargingPolicy: Debug> Debug for CyclesAccounting<ChargingPolicy>
Source§impl<ChargingPolicy> Filter<HttpRequestArgs> for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: CyclesChargingPolicy,
impl<ChargingPolicy> Filter<HttpRequestArgs> for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: CyclesChargingPolicy,
Source§type Error = <ChargingPolicy as CyclesChargingPolicy>::Error
type Error = <ChargingPolicy as CyclesChargingPolicy>::Error
Error type if the input is declared invalid.
Source§fn filter(
&mut self,
request: HttpRequestArgs,
) -> Result<HttpRequestArgs, Self::Error>
fn filter( &mut self, request: HttpRequestArgs, ) -> Result<HttpRequestArgs, Self::Error>
Filter the input and return an error if it fails.
Auto Trait Implementations§
impl<ChargingPolicy> Freeze for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: Freeze,
impl<ChargingPolicy> RefUnwindSafe for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: RefUnwindSafe,
impl<ChargingPolicy> Send for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: Send,
impl<ChargingPolicy> Sync for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: Sync,
impl<ChargingPolicy> Unpin for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: Unpin,
impl<ChargingPolicy> UnsafeUnpin for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: UnsafeUnpin,
impl<ChargingPolicy> UnwindSafe for CyclesAccounting<ChargingPolicy>where
ChargingPolicy: 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