use anyhow::Result;
use axum::http::HeaderMap;
pub trait MetadataMgr<A, M>: Send + Sync {
fn new_from_extension(&self, auth_info: &A, extension: &str) -> Result<M>;
fn new_from_http_headers(&self, headers: &HeaderMap) -> Result<M>;
}
pub struct MetadataMgrImpl {}
impl MetadataMgrImpl {
pub fn new() -> Self {
Self {}
}
}
impl<A> MetadataMgr<A, ()> for MetadataMgrImpl {
fn new_from_extension(&self, _auth_info: &A, _extension: &str) -> Result<()> {
Ok(())
}
fn new_from_http_headers(&self, _headers: &HeaderMap) -> Result<()> {
Ok(())
}
}