pub struct EconomicsSegment {
pub dimension: String,
pub value: String,
pub n: usize,
pub token_reduction: Option<EconomicsDistribution>,
}Expand description
A metric’s value within one segment of the pairs.
use majordomus_cli::economics::model::EconomicsSegment;
let s: EconomicsSegment = serde_json::from_value(serde_json::json!({
"dimension": "category", "value": "multi-session", "n": 0
}))
.unwrap();
assert!(s.token_reduction.is_none(), "a segment with no valid pair has no distribution");Fields§
§dimension: Stringcategory, sessions, complexity.
value: StringThe segment.
n: usizeValid pairs in it.
token_reduction: Option<EconomicsDistribution>Distribution of per-pair token reduction.
Trait Implementations§
Source§impl Clone for EconomicsSegment
impl Clone for EconomicsSegment
Source§fn clone(&self) -> EconomicsSegment
fn clone(&self) -> EconomicsSegment
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 Debug for EconomicsSegment
impl Debug for EconomicsSegment
Source§impl<'de> Deserialize<'de> for EconomicsSegment
impl<'de> Deserialize<'de> for EconomicsSegment
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
Source§impl JsonSchema for EconomicsSegment
impl JsonSchema for EconomicsSegment
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 moreSource§impl PartialEq for EconomicsSegment
impl PartialEq for EconomicsSegment
Source§fn eq(&self, other: &EconomicsSegment) -> bool
fn eq(&self, other: &EconomicsSegment) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EconomicsSegment
impl Serialize for EconomicsSegment
impl StructuralPartialEq for EconomicsSegment
Auto Trait Implementations§
impl Freeze for EconomicsSegment
impl RefUnwindSafe for EconomicsSegment
impl Send for EconomicsSegment
impl Sync for EconomicsSegment
impl Unpin for EconomicsSegment
impl UnsafeUnpin for EconomicsSegment
impl UnwindSafe for EconomicsSegment
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