pub trait ServeableContent: Send + Sync {
// Required methods
fn schema(&self) -> ContentSchema;
fn validate(&self) -> Result<ValidationReport>;
fn to_arrow(&self) -> Result<RecordBatch>;
fn metadata(&self) -> ContentMetadata;
fn content_type(&self) -> ContentTypeId;
fn chunks(
&self,
chunk_size: usize,
) -> Box<dyn Iterator<Item = Result<RecordBatch>> + Send>;
fn to_bytes(&self) -> Result<Vec<u8>>;
}Expand description
Trait for any content that can be served via WASM
This trait provides the abstraction layer between content types (datasets, courses, models, raw data) and the serving infrastructure.
Required Methods§
Sourcefn schema(&self) -> ContentSchema
fn schema(&self) -> ContentSchema
Returns the content schema for validation and UI generation
Sourcefn validate(&self) -> Result<ValidationReport>
fn validate(&self) -> Result<ValidationReport>
Sourcefn to_arrow(&self) -> Result<RecordBatch>
fn to_arrow(&self) -> Result<RecordBatch>
Converts content to Arrow RecordBatch for efficient transfer
§Errors
Returns an error if the content cannot be converted to Arrow format.
Sourcefn metadata(&self) -> ContentMetadata
fn metadata(&self) -> ContentMetadata
Returns content metadata for indexing and discovery
Sourcefn content_type(&self) -> ContentTypeId
fn content_type(&self) -> ContentTypeId
Returns content type identifier