Trait lockchain_core::traits::Body [−][src]
pub trait Body: DeserializeOwned + Serialize + Send { fn get_field(&self, key: &str) -> Option<&Payload>; fn set_field(&mut self, key: &str, value: Payload) -> Option<()>; fn flatten(&mut self) -> Option<()>; }
A Body trait that can be implemented to hook into the generic Record data module.
This allows working with both encrypted and cleartext data bodies.
Required Methods
fn get_field(&self, key: &str) -> Option<&Payload>
Get the value of a field from this body
fn set_field(&mut self, key: &str, value: Payload) -> Option<()>
Set the value of a field
fn flatten(&mut self) -> Option<()>
Remove versioning and flatten the data tree to a single level.
Implementors
impl Body for EncryptedBody