#[non_exhaustive]pub struct AppState {
pub sandbox_engine: Arc<SandboxEngine>,
pub output_scanner: OutputScanner,
pub config: ClawboxConfig,
pub tools: RwLock<HashMap<String, ToolManifest>>,
pub start_time: Instant,
pub credential_store: Option<CredentialStore>,
pub audit_log: AuditLog,
pub rate_limiter: Arc<RateLimiter>,
pub metrics_handle: PrometheusHandle,
pub docker: DockerState,
/* private fields */
}Expand description
Shared state for the clawbox HTTP server.
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.sandbox_engine: Arc<SandboxEngine>§output_scanner: OutputScanner§config: ClawboxConfig§tools: RwLock<HashMap<String, ToolManifest>>§start_time: Instant§credential_store: Option<CredentialStore>§audit_log: AuditLog§rate_limiter: Arc<RateLimiter>§metrics_handle: PrometheusHandle§docker: DockerStateDocker/container state (only present with docker feature).
Implementations§
Source§impl AppState
impl AppState
pub async fn new(config: ClawboxConfig) -> Result<Self, StateError>
Sourcepub async fn docker_status(&self) -> (bool, usize, usize)
pub async fn docker_status(&self) -> (bool, usize, usize)
Returns (docker_available, active_containers, active_agents).
When compiled without the docker feature this always returns (false, 0, 0).
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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