#[non_exhaustive]pub struct CometSpec {
pub version: Option<CometVersion>,
pub source_language: String,
pub target_language: String,
/* private fields */
}Available on crate feature
evaluation-service only.Expand description
Spec for Comet metric.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version: Option<CometVersion>Required. Which version to use for evaluation.
source_language: StringOptional. Source language in BCP-47 format.
target_language: StringOptional. Target language in BCP-47 format. Covers both prediction and reference.
Implementations§
Source§impl CometSpec
impl CometSpec
pub fn new() -> Self
Sourcepub fn set_version<T>(self, v: T) -> Selfwhere
T: Into<CometVersion>,
pub fn set_version<T>(self, v: T) -> Selfwhere
T: Into<CometVersion>,
Sourcepub fn set_or_clear_version<T>(self, v: Option<T>) -> Selfwhere
T: Into<CometVersion>,
pub fn set_or_clear_version<T>(self, v: Option<T>) -> Selfwhere
T: Into<CometVersion>,
Sourcepub fn set_source_language<T: Into<String>>(self, v: T) -> Self
pub fn set_source_language<T: Into<String>>(self, v: T) -> Self
Sets the value of source_language.
§Example
ⓘ
let x = CometSpec::new().set_source_language("example");Sourcepub fn set_target_language<T: Into<String>>(self, v: T) -> Self
pub fn set_target_language<T: Into<String>>(self, v: T) -> Self
Sets the value of target_language.
§Example
ⓘ
let x = CometSpec::new().set_target_language("example");Trait Implementations§
impl StructuralPartialEq for CometSpec
Auto Trait Implementations§
impl Freeze for CometSpec
impl RefUnwindSafe for CometSpec
impl Send for CometSpec
impl Sync for CometSpec
impl Unpin for CometSpec
impl UnwindSafe for CometSpec
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