Impl Contact::get_contact_data()
This commit is contained in:
parent
ce5e7f5252
commit
aae19221b6
1 changed files with 12 additions and 4 deletions
|
@ -23,6 +23,7 @@ use libimagstore::store::Entry;
|
|||
use libimagentryref::reference::Ref;
|
||||
|
||||
use error::Result;
|
||||
use util;
|
||||
|
||||
/// Trait to be implemented on ::libimagstore::store::Entry
|
||||
///
|
||||
|
@ -38,12 +39,19 @@ pub trait Contact : Ref {
|
|||
}
|
||||
|
||||
impl Contact for Entry {
|
||||
|
||||
fn get_contact_data(&self) -> Result<ContactData> {
|
||||
unimplemented!()
|
||||
let component = self
|
||||
.fs_file()
|
||||
.map_err(From::from)
|
||||
.and_then(util::read_to_string)
|
||||
.and_then(util::parse)?;
|
||||
|
||||
Ok(ContactData(component))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pub struct ContactData {
|
||||
components: Vec<Component>,
|
||||
}
|
||||
pub struct ContactData(Component);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue