Split into multiple crates

This commit is contained in:
Elias Projahn 2021-02-04 21:47:22 +01:00
parent d7fb996183
commit 5d06ec9faf
88 changed files with 501 additions and 528 deletions

View file

@ -1,16 +0,0 @@
use crate::backend::{Backend, Person, Result};
impl Backend {
/// Get all available persons from the server.
pub async fn get_persons(&self) -> Result<Vec<Person>> {
let body = self.get("persons").await?;
let persons: Vec<Person> = serde_json::from_str(&body)?;
Ok(persons)
}
/// Post a new person to the server.
pub async fn post_person(&self, data: &Person) -> Result<()> {
self.post("persons", serde_json::to_string(data)?).await?;
Ok(())
}
}