pub struct AppState {Show 32 fields
pub store: Arc<HashtreeStore>,
pub auth: Option<AuthCredentials>,
pub daemon_started_at: u64,
pub peer_mode: ServerMode,
pub hash_get_enabled: bool,
pub http_webrtc_fetch: bool,
pub webrtc_peers: Option<Arc<WebRTCState>>,
pub fips_transport: Option<Arc<DaemonFipsTransport>>,
pub fetch_from_fips_peers: bool,
pub ws_relay: Arc<WsRelayState>,
pub max_upload_bytes: usize,
pub public_writes: bool,
pub public_plaintext_reads: bool,
pub require_random_untrusted_ingest: bool,
pub optimistic_blossom_uploads: bool,
pub optimistic_upload_queue_bytes: usize,
pub optimistic_upload_queue: Arc<Semaphore>,
pub allowed_pubkeys: HashSet<String>,
pub upstream_blossom: Vec<String>,
pub social_graph: Option<Arc<SocialGraphAccessControl>>,
pub social_graph_store: Option<Arc<dyn SocialGraphBackend>>,
pub social_graph_root: Option<[u8; 32]>,
pub socialgraph_snapshot_public: bool,
pub nostr_relay: Option<Arc<NostrRelay>>,
pub nostr_relay_urls: Vec<String>,
pub tree_root_cache: Arc<Mutex<HashMap<String, CachedTreeRootEntry>>>,
pub inflight_blob_fetches: Arc<Mutex<HashMap<String, Shared<BoxFuture<'static, bool>>>>>,
pub inflight_blob_reads: Arc<Mutex<HashMap<String, Shared<BoxFuture<'static, Result<Option<Vec<u8>>, String>>>>>>,
pub directory_listing_cache: Arc<Mutex<TimedLruCache<String, LookupResult<Vec<TreeEntry>>>>>,
pub resolved_path_cache: Arc<Mutex<TimedLruCache<String, LookupResult<CachedResolvedPathEntry>>>>,
pub thumbnail_path_cache: Arc<Mutex<TimedLruCache<String, LookupResult<String>>>>,
pub cid_size_cache: Arc<Mutex<TimedLruCache<String, LookupResult<u64>>>>,
/* private fields */
}Fields§
§store: Arc<HashtreeStore>§auth: Option<AuthCredentials>§daemon_started_at: u64Unix timestamp when this daemon state was created.
peer_mode: ServerMode§hash_get_enabled: bool§http_webrtc_fetch: boolWhether HTTP cache misses should ask connected WebRTC peers before falling back to upstream Blossom.
webrtc_peers: Option<Arc<WebRTCState>>WebRTC peer state for forwarding requests to connected P2P peers
fips_transport: Option<Arc<DaemonFipsTransport>>FIPS-backed Hashtree blob transport for peer fetches and responses.
fetch_from_fips_peers: bool§ws_relay: Arc<WsRelayState>WebSocket relay state for /ws clients
max_upload_bytes: usizeMaximum upload size in bytes for Blossom uploads (default: 5 MB)
public_writes: boolAllow anyone with valid Nostr auth to write (default: true) When false, only allowed_pubkeys can write
public_plaintext_reads: boolAllow public plaintext reads from mutable npub routes (default: true) When false, only allowed_pubkeys or social graph approved pubkeys can read.
require_random_untrusted_ingest: boolRequire untrusted cached blob ingress to look like encrypted CHK blobs.
optimistic_blossom_uploads: boolReturn from Blossom upload after validation while storage writes finish in a bounded background queue.
optimistic_upload_queue_bytes: usizeBackground upload queue byte budget. Each queued body holds one permit per byte until the storage write completes.
optimistic_upload_queue: Arc<Semaphore>§allowed_pubkeys: HashSet<String>Pubkeys allowed to write (hex format, from config allowed_npubs)
upstream_blossom: Vec<String>Upstream Blossom servers for cascade fetching
Social graph access control
Social graph store handle for snapshot export
Social graph root pubkey bytes for snapshot export
Allow public access to social graph snapshot endpoint
nostr_relay: Option<Arc<NostrRelay>>Nostr relay state for /ws and WebRTC Nostr messages
nostr_relay_urls: Vec<String>Active upstream Nostr relays for HTTP resolver operations.
tree_root_cache: Arc<Mutex<HashMap<String, CachedTreeRootEntry>>>In-process cache for resolved mutable tree roots, keyed by npub/tree(+key)
inflight_blob_fetches: Arc<Mutex<HashMap<String, Shared<BoxFuture<'static, bool>>>>>Shared in-flight blob fetches so concurrent misses only hit upstream once per hash
inflight_blob_reads: Arc<Mutex<HashMap<String, Shared<BoxFuture<'static, Result<Option<Vec<u8>>, String>>>>>>Shared in-flight local blob reads so request bursts for the same hash only spend one blocking storage read.
directory_listing_cache: Arc<Mutex<TimedLruCache<String, LookupResult<Vec<TreeEntry>>>>>Immutable directory listings keyed by CID
resolved_path_cache: Arc<Mutex<TimedLruCache<String, LookupResult<CachedResolvedPathEntry>>>>Immutable resolved paths keyed by root CID + path
thumbnail_path_cache: Arc<Mutex<TimedLruCache<String, LookupResult<String>>>>Immutable thumbnail alias resolutions keyed by root CID + alias path
cid_size_cache: Arc<Mutex<TimedLruCache<String, LookupResult<u64>>>>Immutable file sizes keyed by CID
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Freeze for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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