pub struct AppState {
pub db_pool: Pool<Any>,
pub github_client: Arc<GithubApiClient>,
pub repo_config: RepoConfig,
pub webhook_secret: WebhookSecret,
pub llm_evaluator: Arc<dyn LlmEvaluator>,
pub llm_semaphore: Arc<Semaphore>,
pub oauth_config: OAuthConfig,
pub repo_config_loader: Arc<RepoConfigLoader>,
}Expand description
Application state for Axum dependency injection
This is the DI root that contains all shared resources needed by handlers:
- Database connection pool
- GitHub API client
- Repository configuration
- Webhook secret for HMAC verification
- LLM evaluator for content quality assessment
- Semaphore for limiting concurrent LLM evaluations
- OAuth configuration for admin authentication
Fields§
§db_pool: Pool<Any>Database connection pool
github_client: Arc<GithubApiClient>GitHub API client for operations like closing PRs
repo_config: RepoConfigRepository credit configuration
webhook_secret: WebhookSecretWebhook secret for HMAC verification
llm_evaluator: Arc<dyn LlmEvaluator>LLM evaluator for content quality assessment
llm_semaphore: Arc<Semaphore>Semaphore for limiting concurrent LLM evaluations
oauth_config: OAuthConfigOAuth configuration for admin authentication
repo_config_loader: Arc<RepoConfigLoader>Repository configuration loader with caching
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(
db_pool: Pool<Any>,
github_client: GithubApiClient,
repo_config: RepoConfig,
webhook_secret: WebhookSecret,
llm_evaluator: Arc<dyn LlmEvaluator>,
max_concurrent_llm_evals: usize,
oauth_config: OAuthConfig,
config_cache_ttl_seconds: u64,
) -> Self
pub fn new( db_pool: Pool<Any>, github_client: GithubApiClient, repo_config: RepoConfig, webhook_secret: WebhookSecret, llm_evaluator: Arc<dyn LlmEvaluator>, max_concurrent_llm_evals: usize, oauth_config: OAuthConfig, config_cache_ttl_seconds: u64, ) -> Self
Create new application state
Trait Implementations§
Source§impl FromRef<AppState> for Arc<GithubApiClient>
Implement FromRef to allow auth middleware to access GithubApiClient
impl FromRef<AppState> for Arc<GithubApiClient>
Implement FromRef to allow auth middleware to access GithubApiClient
Source§impl FromRef<AppState> for OAuthConfig
Implement FromRef to allow OAuth handlers to access OAuthConfig
impl FromRef<AppState> for OAuthConfig
Implement FromRef to allow OAuth handlers to access OAuthConfig
Source§impl FromRef<AppState> for WebhookSecret
Implement FromRef to allow VerifiedWebhook extractor to access WebhookSecret
impl FromRef<AppState> for WebhookSecret
Implement FromRef to allow VerifiedWebhook extractor to access WebhookSecret
Source§impl FromRequest<AppState> for VerifiedWebhookPayload
impl FromRequest<AppState> for VerifiedWebhookPayload
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin 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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more