pub struct AdminConfig {
pub enabled: bool,
pub auth_token: Option<String>,
pub require_auth: bool,
pub mount_path: String,
pub max_keys_per_request: usize,
pub max_hot_keys: usize,
}Expand description
Configuration for the admin API.
Fields§
§enabled: boolWhether admin API is enabled
auth_token: Option<String>Optional authentication token (Bearer token)
require_auth: boolWhether authentication is required
mount_path: StringMount path for admin endpoints (e.g., “/admin/cache”)
max_keys_per_request: usizeMaximum number of keys to return in listing endpoints
max_hot_keys: usizeMaximum number of hot keys to track
Implementations§
Source§impl AdminConfig
impl AdminConfig
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Enables the admin API.
Sourcepub fn with_auth_token(self, token: impl Into<String>) -> Self
pub fn with_auth_token(self, token: impl Into<String>) -> Self
Sets the authentication token.
Sourcepub fn with_require_auth(self, require: bool) -> Self
pub fn with_require_auth(self, require: bool) -> Self
Sets whether authentication is required.
Sourcepub fn with_mount_path(self, path: impl Into<String>) -> Self
pub fn with_mount_path(self, path: impl Into<String>) -> Self
Sets the mount path.
Sourcepub fn validate_token(&self, provided: Option<&str>) -> bool
pub fn validate_token(&self, provided: Option<&str>) -> bool
Validates the authentication token.
Trait Implementations§
Source§impl Clone for AdminConfig
impl Clone for AdminConfig
Source§fn clone(&self) -> AdminConfig
fn clone(&self) -> AdminConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdminConfig
impl Debug for AdminConfig
Auto Trait Implementations§
impl Freeze for AdminConfig
impl RefUnwindSafe for AdminConfig
impl Send for AdminConfig
impl Sync for AdminConfig
impl Unpin for AdminConfig
impl UnwindSafe for AdminConfig
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