pub struct ExportBundle {
pub bundle_version: String,
pub exported_at: Timestamp,
pub dataset: ExportDataset,
pub metadata: Option<Map<String, Value>>,
}Expand description
A portable export bundle. JSON-compatible with the TS ExportBundle.
Fields§
§bundle_version: StringBundle format version ("1.0").
exported_at: TimestampExport timestamp (epoch ms).
dataset: ExportDatasetThe entity dataset.
metadata: Option<Map<String, Value>>Optional metadata. Declared after dataset to match the TS field
order; omitted from JSON when absent.
Implementations§
Source§impl ExportBundle
impl ExportBundle
Sourcepub fn to_json(&self, pretty: bool) -> ServiceResult<String>
pub fn to_json(&self, pretty: bool) -> ServiceResult<String>
Serialize to JSON. pretty switches between compact (single line, TS
JSON.stringify(bundle, null, 0)) and 2-space pretty printing.
Sourcepub fn from_json(json: &str) -> ServiceResult<Self>
pub fn from_json(json: &str) -> ServiceResult<Self>
Parse a bundle from JSON, validating its structure (version + required
arrays). Mirrors deserializeBundle + validateBundle.
Sourcepub fn validate(&self) -> ServiceResult<()>
pub fn validate(&self) -> ServiceResult<()>
Structural validation. Errors mirror the messages produced by the TS
validateBundle for the version checks (the array/required-field checks
are enforced statically by the typed deserialization above).
Sourcepub fn stats(&self) -> ServiceResult<ExportStats>
pub fn stats(&self) -> ServiceResult<ExportStats>
Bundle statistics (entity counts + serialized size). Mirrors
getBundleStats.
Trait Implementations§
Source§impl Clone for ExportBundle
impl Clone for ExportBundle
Source§fn clone(&self) -> ExportBundle
fn clone(&self) -> ExportBundle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExportBundle
impl Debug for ExportBundle
Source§impl<'de> Deserialize<'de> for ExportBundle
impl<'de> Deserialize<'de> for ExportBundle
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>,
Source§impl PartialEq for ExportBundle
impl PartialEq for ExportBundle
Source§fn eq(&self, other: &ExportBundle) -> bool
fn eq(&self, other: &ExportBundle) -> bool
self and other values to be equal, and is used by ==.