pub trait Serializer: Plugin {
// Required methods
fn format(&self) -> &str;
fn export(
&self,
data: &[HashMap<String, PropertyValue>],
) -> Result<Vec<u8>, CypherLiteError>;
fn import(
&self,
bytes: &[u8],
) -> Result<Vec<HashMap<String, PropertyValue>>, CypherLiteError>;
}Expand description
A custom serialization format for import/export operations.
Uses HashMap<String, PropertyValue> as the row representation to avoid
a circular dependency on the query crate’s Row type.
Required Methods§
Sourcefn export(
&self,
data: &[HashMap<String, PropertyValue>],
) -> Result<Vec<u8>, CypherLiteError>
fn export( &self, data: &[HashMap<String, PropertyValue>], ) -> Result<Vec<u8>, CypherLiteError>
Serialize a slice of rows into bytes.
Sourcefn import(
&self,
bytes: &[u8],
) -> Result<Vec<HashMap<String, PropertyValue>>, CypherLiteError>
fn import( &self, bytes: &[u8], ) -> Result<Vec<HashMap<String, PropertyValue>>, CypherLiteError>
Deserialize bytes into a vector of rows.