pub struct Metered {
pub budget: String,
pub unit: String,
pub measured: u64,
pub modelled: u64,
}Expand description
What one source’s requests have spent against one budget, split by where each figure came from.
Two amounts rather than one beside a flag: a figure the backend reported or a request counted is a measurement, while a figure the source modelled is a lower bound on what the backend charged. A caller adding readings up has to keep the two apart to say which a total is.
Fields§
§budget: StringThe budget, as the backend names it — graphql, rest.
unit: StringWhat the budget is metered in — points, requests.
measured: u64How much was spent against it that the backend reported, or that is a count of requests against a budget metered in requests.
modelled: u64How much was spent against it that this source modelled rather than measured, which is a lower bound on what the backend charged for it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metered
impl<'de> Deserialize<'de> for Metered
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Metered
Source§impl JsonSchema for Metered
impl JsonSchema for Metered
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Metered
Auto Trait Implementations§
impl Freeze for Metered
impl RefUnwindSafe for Metered
impl Send for Metered
impl Sync for Metered
impl Unpin for Metered
impl UnsafeUnpin for Metered
impl UnwindSafe for Metered
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