pub fn book_read(book: &Book) -> VResult<Option<SyncConfig>> {
    if !book.has_item(ITEM_NAME_SYNC_CONFIG) {
        debug!("Syncronization configuration not set for the book");
        Ok(None)
    } else {
        let item = book.get_item_by_name(ITEM_NAME_SYNC_CONFIG).unwrap();
        let config_data = item.password.ok_or(Error::ConfigurationItem)?.plaintext();
        Ok(Some(
            serde_json::from_str(&config_data).map_err(|_| Error::ConfigurationItem)?,
        ))
    }
}
/// Read synchronization configuration from a book
Read synchronization configuration from a book
Read synchronization configuration from a book
pub fn book_read(book: &Book) -> VResult<Option<SyncConfig>> {
    if !book.has_item(ITEM_NAME_SYNC_CONFIG) {
        debug!("Syncronization configuration not set for the book");
        Ok(None)
    } else {
        let item = book.get_item_by_name(ITEM_NAME_SYNC_CONFIG).unwrap();
        let config_data = item.password.ok_or(Error::ConfigurationItem)?.plaintext();
        Ok(Some(
            serde_json::from_str(&config_data).map_err(|_| Error::ConfigurationItem)?,
        ))
    }
}
pub fn book_read ( book : & Book ) -> VResult < Option < SyncConfig > > { if ! book . has_item ( ITEM_NAME_SYNC_CONFIG ) { debug ! ( " " ) ; Ok ( None ) } else { let item = book . get_item_by_name ( ITEM_NAME_SYNC_CONFIG ) . unwrap ( ) ; let config_data = item . password . ok_or ( Error :: ConfigurationItem ) ? . plaintext ( ) ; Ok ( Some ( serde_json :: from_str ( & config_data ) . map_err ( | _ | Error :: ConfigurationItem ) ? , ) ) } }
Read synchronization configuration from a book
Read synchronization configuration from a book
book
&Book
book
&Book