Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created September 30, 2021 14:48
Show Gist options
  • Save ntakouris/61a965eb5dc2bcc3fefd69d847092b91 to your computer and use it in GitHub Desktop.
Save ntakouris/61a965eb5dc2bcc3fefd69d847092b91 to your computer and use it in GitHub Desktop.
pub trait DB: Send + Sync {
// fill out your own `Err` types
fn save(&self, resource: DataResource) -> Result<(), String>;
fn retrieve(&self, id: &String) -> Result<Option<DataResource>, String>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment