pub struct Cost {
pub layer: LayerId,
pub units: u32,
pub exact: bool,
}Expand description
What a request costs one layer of a throttle.
The venue’s request builder computes these from its route table. A layer that counts requests finds its own bucket from the method and path, and needs no entry here.
Fields§
§layer: LayerIdThe layer charged.
units: u32Tokens the request costs that layer.
exact: boolWhether units is the true cost. Only an exact cost may be refused
before sending; an inexact one is a floor, and the server decides.
Trait Implementations§
impl Copy for Cost
impl Eq for Cost
impl StructuralPartialEq for Cost
Auto Trait Implementations§
impl Freeze for Cost
impl RefUnwindSafe for Cost
impl Send for Cost
impl Sync for Cost
impl Unpin for Cost
impl UnsafeUnpin for Cost
impl UnwindSafe for Cost
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