Struct libimagstore::store::Entry
[−]
[src]
pub struct Entry { /* fields omitted */ }An Entry of the store Contains location, header and content part.
Methods
impl Entry[src]
fn new(loc: StoreId) -> Entry[src]
Create a new store entry with its location at loc.
This creates the entry with the default header from Entry::default_header() and an empty
content.
fn default_header() -> Value[src]
Get the default Header for an Entry.
This function should be used to get a new Header, as the default header may change. Via this function, compatibility is ensured.
fn from_reader<S: IntoStoreId>(loc: S, file: &mut Read) -> Result<Entry>[src]
See Entry::from_str(), as this function is used internally. This is just a wrapper for
convenience.
fn from_str<S: IntoStoreId>(loc: S, s: &str) -> Result<Entry>[src]
Create a new Entry, with contents from the string passed.
The passed string must be a complete valid store entry, including header. So this is probably not what end-users want to call.
Return value
This errors if
- String cannot be matched on regex to find header and content
- Header cannot be parsed into a TOML object
fn to_str(&self) -> String[src]
Return the string representation of this entry
This means not only the content of the entry, but the complete entry (from memory, not from disk).
fn get_location(&self) -> &StoreId[src]
Get the location of the Entry
fn get_header(&self) -> &Value[src]
Get the header of the Entry
fn get_header_mut(&mut self) -> &mut Value[src]
Get the header mutably of the Entry
fn get_content(&self) -> &EntryContent[src]
Get the content of the Entry
fn get_content_mut(&mut self) -> &mut EntryContent[src]
Get the content mutably of the Entry
fn verify(&self) -> Result<()>[src]
Verify the entry.
Currently, this only verifies the header. This might change in the future.
Trait Implementations
impl Debug for Entry[src]
impl Clone for Entry[src]
fn clone(&self) -> Entry[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more