pub struct BenchmarkSet {
pub cases: Vec<BenchmarkCase>,
}Expand description
A set of benchmark cases loaded from a TOML file.
§TOML format
[[cases]]
prompt = "What is the capital of France?"
reference = "Paris"
tags = ["geography", "factual"]
[[cases]]
prompt = "Explain async/await in Rust."
context = "You are a Rust expert."Fields§
§cases: Vec<BenchmarkCase>Implementations§
Source§impl BenchmarkSet
impl BenchmarkSet
Sourcepub fn from_file(path: &Path) -> Result<Self, EvalError>
pub fn from_file(path: &Path) -> Result<Self, EvalError>
Load a benchmark set from a TOML file.
Performs size guard (10 MiB limit) and canonicalisation before reading. Symlinks that escape the file’s parent directory are rejected.
§Errors
Returns EvalError::BenchmarkLoad if the file cannot be read,
EvalError::BenchmarkParse if the TOML is invalid,
EvalError::BenchmarkTooLarge if the file exceeds the size limit, or
EvalError::PathTraversal if canonicalization reveals a symlink escape.
Trait Implementations§
Source§impl Clone for BenchmarkSet
impl Clone for BenchmarkSet
Source§fn clone(&self) -> BenchmarkSet
fn clone(&self) -> BenchmarkSet
Returns a duplicate of the value. Read more
1.0.0 · 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 BenchmarkSet
impl Debug for BenchmarkSet
Source§impl<'de> Deserialize<'de> for BenchmarkSet
impl<'de> Deserialize<'de> for BenchmarkSet
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
Auto Trait Implementations§
impl Freeze for BenchmarkSet
impl RefUnwindSafe for BenchmarkSet
impl Send for BenchmarkSet
impl Sync for BenchmarkSet
impl Unpin for BenchmarkSet
impl UnsafeUnpin for BenchmarkSet
impl UnwindSafe for BenchmarkSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request