Some checks failed
Create and publish a Docker image / build-and-push-image (push) Has been cancelled
23 lines
816 B
Rust
23 lines
816 B
Rust
use std::collections::HashMap;
|
|
|
|
use sqlx::{Postgres, Transaction};
|
|
|
|
|
|
|
|
pub trait SeptaJson {}
|
|
|
|
pub trait FromSeptaJson<T: SeptaJson> {
|
|
fn from_septa_json(septa_json: T) -> ::anyhow::Result<Box<Self>>;
|
|
}
|
|
|
|
pub trait FromSeptaJsonAndStations<T: SeptaJson> {
|
|
fn from_septa_json(septa_json: T, stop_map: &HashMap<String, i64>) -> ::anyhow::Result<Box<Self>>;
|
|
}
|
|
|
|
pub trait DbObj<T> {
|
|
fn create_table(tx: &mut Transaction<'_, Postgres>) -> impl std::future::Future< Output = ::anyhow::Result<()>> + Send;
|
|
fn insert(&self, tx: &mut Transaction<'_, Postgres>) -> impl std::future::Future< Output = ::anyhow::Result<()>> + Send;
|
|
fn insert_many(s: Vec<T>, tx: &mut Transaction<'_, Postgres>) -> impl std::future::Future< Output = ::anyhow::Result<()>> + Send;
|
|
}
|
|
|
|
pub trait Fetchable<T: SeptaJson> {}
|