Registry / RepositoryTypeScriptRustPython
Rollpie
ReadmeFiles
Versions
Info
Download
0.1.280.1 KB2026-09-140.1.167.6 KB2026-09-140.1.064.9 KB2026-09-14
Version
0.1.2
Copyright
Rollpie, Irohabook
Publisher
math
Published
2026-09-14
Size
80.1 KB
Downloads
1
Checksum
65387e928cd11d6abf76cfb0f7a839dd3b2b7bb9cdbe78e7b058d3213d9fbcc2
Dependencies
None

state.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! 全ハンドラで共有する状態

use crate::conf::Conf;
use crate::session::Store;
use sqlx::SqlitePool;
use std::sync::Arc;


/// 共有状態。中身はどれも参照カウントを持つので Clone は安価である
#[derive(Clone)]
pub struct AppState {
    /// SQLite の接続プール
    pub database: SqlitePool,
    /// 中継に使う HTTP クライアント
    pub client: reqwest::Client,
    /// セッションの置き場
    pub session: Store,
    /// 起動時に読んだ設定
    pub conf: Arc<Conf>,
}