summaryrefslogtreecommitdiffstats
path: root/src/state.rs
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2025-07-12 16:46:32 +0200
committerrtkay123 <dev@kanjala.com>2025-07-12 16:46:32 +0200
commita56b12621d9f8c34017995a518e61ef7ee2b0f64 (patch)
tree0a2ea448bffe44ad7724091dfd276b10ca671908 /src/state.rs
parent93ce338cba3e4488fc36ea9159167884d6cd9eb9 (diff)
downloadsellershut-a56b12621d9f8c34017995a518e61ef7ee2b0f64.tar.bz2
sellershut-a56b12621d9f8c34017995a518e61ef7ee2b0f64.zip
feat: get user
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/state.rs b/src/state.rs
index 64c2e7c..d7c9136 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -1,14 +1,12 @@
-use std::{
- ops::Deref,
- sync::{Arc, RwLock},
-};
+use std::{ops::Deref, sync::Arc};
use activitypub_federation::config::FederationConfig;
+use tokio::sync::RwLock;
-use crate::{entity::user::LocalUser, error::AppError};
+use crate::{entity::user::User, error::AppError};
#[derive(Clone)]
-pub struct AppHandle(pub Arc<AppState>);
+pub struct AppHandle(Arc<AppState>);
impl Deref for AppHandle {
type Target = Arc<AppState>;
@@ -19,12 +17,12 @@ impl Deref for AppHandle {
}
pub struct AppState {
- users: RwLock<Vec<LocalUser>>,
+ pub users: RwLock<Vec<User>>,
}
impl AppState {
pub async fn new() -> Result<FederationConfig<AppHandle>, AppError> {
- let user = LocalUser::new("sellershut")?;
+ let user = User::new("sellershut")?;
let domain = "localhost";
let config = FederationConfig::builder()