Struct lockchain_core::Record
[−]
[src]
pub struct Record<T: Body> { pub header: Header, pub body: Option<T>, }
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]
pub fn new(name: &str, category: &str, tags: Vec<&str>) -> Self
[src]
Create a new Record, generically for a backend in question
pub fn add_data(&mut self, key: &str, value: Payload) -> Option<()>
[src]
Attempt to set a key to a certain value
pub fn get_data(&self, key: &str) -> Option<&Payload>
[src]
Attempt to read out the value of a certain key
Trait Implementations
impl<T: Debug + Body> Debug for Record<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: Eq + Body> Eq for Record<T>
[src]
impl<T: PartialEq + Body> PartialEq for Record<T>
[src]
fn eq(&self, __arg_0: &Record<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Record<T>) -> bool
[src]
This method tests for !=
.