#[non_exhaustive]pub struct AppState {
pub repo: Arc<MemoryRepo>,
pub embedding: Box<dyn EmbeddingBackend>,
pub index: ScopedIndex,
pub auth: AuthProvider,
pub branch: String,
}Expand description
Shared application state threaded through the Axum server.
Wrapped in a single outer Arc at the call site. repo is additionally
wrapped in its own Arc so it can be cloned into spawn_blocking closures.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.repo: Arc<MemoryRepo>Git-backed memory repository.
embedding: Box<dyn EmbeddingBackend>Backend used to compute text embeddings.
index: ScopedIndexIn-memory vector index for semantic search (scope-partitioned).
auth: AuthProviderAuthentication provider for API access control.
branch: StringBranch name used for push/pull operations (default: “main”).
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(
repo: Arc<MemoryRepo>,
branch: String,
embedding: Box<dyn EmbeddingBackend>,
index: ScopedIndex,
auth: AuthProvider,
) -> Self
pub fn new( repo: Arc<MemoryRepo>, branch: String, embedding: Box<dyn EmbeddingBackend>, index: ScopedIndex, auth: AuthProvider, ) -> Self
Create a new application state from subsystem instances.
Auto Trait Implementations§
impl !Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin 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> 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