pub struct AdminState { /* private fields */ }Expand description
Shared application state for admin handlers.
This struct is cloneable and cheap to clone since StandardEngine uses
Arc internally.
Implementations§
Source§impl AdminState
impl AdminState
Sourcepub fn new(
engine: StandardEngine,
max_connections: usize,
request_timeout: Duration,
auth_required: bool,
auth_token: Option<String>,
) -> Self
pub fn new( engine: StandardEngine, max_connections: usize, request_timeout: Duration, auth_required: bool, auth_token: Option<String>, ) -> Self
Create a new AdminState.
Sourcepub fn engine(&self) -> &StandardEngine
pub fn engine(&self) -> &StandardEngine
Get a reference to the database engine.
Sourcepub fn engine_clone(&self) -> StandardEngine
pub fn engine_clone(&self) -> StandardEngine
Get a clone of the database engine.
Sourcepub fn max_connections(&self) -> usize
pub fn max_connections(&self) -> usize
Get the maximum connections.
Sourcepub fn request_timeout(&self) -> Duration
pub fn request_timeout(&self) -> Duration
Get the request timeout.
Sourcepub fn auth_required(&self) -> bool
pub fn auth_required(&self) -> bool
Check if authentication is required.
Sourcepub fn auth_token(&self) -> Option<&str>
pub fn auth_token(&self) -> Option<&str>
Get the auth token (if set).
Trait Implementations§
Source§impl Clone for AdminState
impl Clone for AdminState
Source§fn clone(&self) -> AdminState
fn clone(&self) -> AdminState
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AdminState
impl !RefUnwindSafe for AdminState
impl Send for AdminState
impl Sync for AdminState
impl Unpin for AdminState
impl !UnwindSafe for AdminState
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)