Struct lockchain_core::Record [−][src]
Represents a whole record in memory
The body field can be None
if it hasn't been cached
yet. Calling body()
will either resolve the data from disk
or still return None
if the current setting doesn't support
body loading (such as the lockchain-server
which has no
cryptocraphy subsystem)
Fields
header: Header
body: Option<T>
Methods
impl<T: Body> Record<T>
[src]
impl<T: Body> Record<T>
pub fn new(name: &str, category: &str, tags: Vec<&str>) -> Self
[src]
pub fn new(name: &str, category: &str, tags: Vec<&str>) -> Self
Create a new Record, generically for a backend in question
pub fn add_data(&mut self, key: &str, value: Payload) -> Option<()>
[src]
pub fn add_data(&mut self, key: &str, value: Payload) -> Option<()>
Attempt to set a key to a certain value
pub fn get_data(&self, key: &str) -> Option<&Payload>
[src]
pub fn get_data(&self, key: &str) -> Option<&Payload>
Attempt to read out the value of a certain key
Trait Implementations
impl<T: Debug + Body> Debug for Record<T>
[src]
impl<T: Debug + Body> Debug for Record<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Eq + Body> Eq for Record<T>
[src]
impl<T: Eq + Body> Eq for Record<T>
impl<T: PartialEq + Body> PartialEq for Record<T>
[src]
impl<T: PartialEq + Body> PartialEq for Record<T>
fn eq(&self, other: &Record<T>) -> bool
[src]
fn eq(&self, other: &Record<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Record<T>) -> bool
[src]
fn ne(&self, other: &Record<T>) -> bool
This method tests for !=
.
impl<T: Clone + Body> Clone for Record<T>
[src]
impl<T: Clone + Body> Clone for Record<T>
fn clone(&self) -> Record<T>
[src]
fn clone(&self) -> Record<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Body> AutoEncoder for Record<T>
[src]
impl<T: Body> AutoEncoder for Record<T>
fn encode(&self) -> Result<String, SerdeError>
[src]
fn encode(&self) -> Result<String, SerdeError>
fn decode(s: &str) -> Result<Self, SerdeError>
[src]
fn decode(s: &str) -> Result<Self, SerdeError>