pub struct AppState {
pub db: MySqlPool,
pub config: Arc<AppConfig>,
pub http_client: Client,
pub manga_tran_name_cache: MangaTranNameCache,
pub manga_ori_name_cache: MangaTranNameCache,
pub member_all_cache: MemberAllCache,
pub auth_snapshot_cache: AuthSnapshotCache,
pub episode_tasks_cache: EpisodeTasksCache,
pub member_task_counts_cache: MemberTaskCountsCache,
pub rss_file_lock: Arc<RssFileLock>,
pub started_at: Instant,
}Expand description
共享应用状态,注入到各 handler
Fields§
§db: MySqlPool数据库连接池
config: Arc<AppConfig>运行时配置
http_client: Client出站 HTTP 客户端
manga_tran_name_cache: MangaTranNameCache漫画译名列表缓存
manga_ori_name_cache: MangaTranNameCache漫画原名列表缓存
member_all_cache: MemberAllCache全量组员列表缓存
auth_snapshot_cache: AuthSnapshotCache鉴权用组员快照缓存
episode_tasks_cache: EpisodeTasksCache待做稿件列表缓存
member_task_counts_cache: MemberTaskCountsCache组员任务计数缓存
rss_file_lock: Arc<RssFileLock>RSS 文件 per-file 互斥锁
started_at: Instant进程启动时刻
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl !UnwindSafe for AppState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request