pub fn create(key: &str, book: &Book, password: &str) -> VResult<()> {
    if let Some(mut service) = load_service(book)? {
        if (*service).exists(key)? {
            return Err(Error::KeyAlreadyExists(key.to_owned()).into());
        }
        let data = crate::encrypt(password, book.clone())?;
        service.create(key, data)?;
    }
    Ok(())
}
/// Pushes new vault to remote, causes error if it already exists.
/// Unsynchronized books are skipped with Ok.
Pushes new vault to remote, causes error if it already exists.
Unsynchronized books are skipped with Ok.
Pushes new vault to remote causes error if it already exists . Unsynchronized books are skipped with Ok .
pub fn create(key: &str, book: &Book, password: &str) -> VResult<()> {
    if let Some(mut service) = load_service(book)? {
        if (*service).exists(key)? {
            return Err(Error::KeyAlreadyExists(key.to_owned()).into());
        }
        let data = crate::encrypt(password, book.clone())?;
        service.create(key, data)?;
    }
    Ok(())
}
pub fn create ( key : & str , book : & Book , password : & str ) -> VResult < ( ) > { if let Some ( mut service ) = load_service ( book ) ? { if ( * service ) . exists ( key ) ? { return Err ( Error :: KeyAlreadyExists ( key . to_owned ( ) ) . into ( ) ) ; } let data = crate :: encrypt ( password , book . clone ( ) ) ? ; service . create ( key , data ) ? ; } Ok ( ( ) ) }
Pushes new vault to remote, causes error if it already exists.
Pushes new vault to remote causes error if it already exists .
key
&str
book
&Book
password
&str
key
&str
book
&Book
password
&str