pub struct ScoreBody {
pub name: String,
pub value: ScoreValue,
pub trace_id: Option<String>,
pub observation_id: Option<String>,
pub comment: Option<String>,
pub metadata: Option<Value>,
pub config_id: Option<String>,
pub data_type: Option<ScoreDataType>,
}Expand description
Body for creating a score.
Fields§
§name: StringName of the score metric.
value: ScoreValueThe score value.
trace_id: Option<String>Trace ID this score belongs to.
observation_id: Option<String>Observation ID this score belongs to.
comment: Option<String>Optional human-readable comment.
metadata: Option<Value>Optional metadata as JSON.
config_id: Option<String>Optional score config ID.
data_type: Option<ScoreDataType>Optional data type override.
Implementations§
Source§impl ScoreBody
impl ScoreBody
Sourcepub fn builder(name: impl Into<String>, value: ScoreValue) -> ScoreBodyBuilder
pub fn builder(name: impl Into<String>, value: ScoreValue) -> ScoreBodyBuilder
Create a new builder with the required name and value.
ⓘ
let body = ScoreBody::builder("accuracy", ScoreValue::Numeric(0.95))
.comment("High accuracy")
.build();Trait Implementations§
Source§impl<'de> Deserialize<'de> for ScoreBody
impl<'de> Deserialize<'de> for ScoreBody
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScoreBody, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScoreBody, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ScoreBody
impl Serialize for ScoreBody
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ScoreBody
impl RefUnwindSafe for ScoreBody
impl Send for ScoreBody
impl Sync for ScoreBody
impl Unpin for ScoreBody
impl UnsafeUnpin for ScoreBody
impl UnwindSafe for ScoreBody
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