@@ -1,5 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::forest_client::GrpcForestClient;
|
||||
use crate::templates::TemplateEngine;
|
||||
use forage_core::auth::ForestAuth;
|
||||
use forage_core::platform::ForestPlatform;
|
||||
@@ -11,6 +12,7 @@ pub struct AppState {
|
||||
pub forest_client: Arc<dyn ForestAuth>,
|
||||
pub platform_client: Arc<dyn ForestPlatform>,
|
||||
pub sessions: Arc<dyn SessionStore>,
|
||||
pub grpc_client: Option<Arc<GrpcForestClient>>,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
@@ -25,6 +27,12 @@ impl AppState {
|
||||
forest_client,
|
||||
platform_client,
|
||||
sessions,
|
||||
grpc_client: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_grpc_client(mut self, client: Arc<GrpcForestClient>) -> Self {
|
||||
self.grpc_client = Some(client);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user