pub struct Dataset {
pub metadata: DatasetMetadata,
pub data: Vec<Value>,
}Expand description
Dataset representation
Fields§
§metadata: DatasetMetadataDataset metadata
data: Vec<Value>Dataset data
Implementations§
Source§impl Dataset
impl Dataset
Sourcepub fn new(metadata: DatasetMetadata, data: Vec<Value>) -> Self
pub fn new(metadata: DatasetMetadata, data: Vec<Value>) -> Self
Create a new dataset from generation result
Sourcepub fn from_generation_result(
name: String,
schema_name: String,
result: GenerationResult,
config: DataConfig,
) -> Self
pub fn from_generation_result( name: String, schema_name: String, result: GenerationResult, config: DataConfig, ) -> Self
Create dataset from generation result
Sourcepub fn to_json_string(&self) -> Result<String>
pub fn to_json_string(&self) -> Result<String>
Get dataset as JSON string
Sourcepub fn to_jsonl_string(&self) -> Result<String>
pub fn to_jsonl_string(&self) -> Result<String>
Get dataset as JSON Lines string
Sourcepub fn to_csv_string(&self) -> Result<String>
pub fn to_csv_string(&self) -> Result<String>
Get dataset as CSV string (basic implementation)
Sourcepub fn to_yaml_string(&self) -> Result<String>
pub fn to_yaml_string(&self) -> Result<String>
Get dataset as YAML string
Sourcepub async fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub async fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load dataset from file
Sourcepub fn validate_against_schema(
&self,
schema: &SchemaDefinition,
) -> Result<Vec<String>>
pub fn validate_against_schema( &self, schema: &SchemaDefinition, ) -> Result<Vec<String>>
Validate this dataset against a schema
Sourcepub fn validate_with_details(
&self,
schema: &SchemaDefinition,
) -> DatasetValidationResult
pub fn validate_with_details( &self, schema: &SchemaDefinition, ) -> DatasetValidationResult
Validate this dataset with detailed results
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dataset
impl RefUnwindSafe for Dataset
impl Send for Dataset
impl Sync for Dataset
impl Unpin for Dataset
impl UnwindSafe for Dataset
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