global: MASSIVE snapshot

This commit is contained in:
nym21
2026-01-07 01:16:37 +01:00
parent e832ffbe23
commit cb0abc324e
487 changed files with 21155 additions and 13627 deletions
+5 -9
View File
@@ -1,4 +1,6 @@
use std::{ops::Deref, path::PathBuf, sync::Arc};
use std::{path::PathBuf, sync::Arc};
use derive_more::Deref;
use axum::{
body::{Body, Bytes},
@@ -13,20 +15,14 @@ use crate::{
extended::{ResponseExtended, ResultExtended},
};
#[derive(Clone)]
#[derive(Clone, Deref)]
pub struct AppState {
#[deref]
pub query: AsyncQuery,
pub path: Option<PathBuf>,
pub cache: Arc<Cache<String, Bytes>>,
}
impl Deref for AppState {
type Target = AsyncQuery;
fn deref(&self) -> &Self::Target {
&self.query
}
}
impl AppState {
/// JSON response with caching
pub async fn cached_json<T, F>(