pub struct PathAuthConfig { /* private fields */ }Expand description
Path-based authentication configuration 基于路径的鉴权配置
Configure which paths require authentication and which are excluded 配置哪些路径需要鉴权,哪些路径被排除
Implementations§
Source§impl PathAuthConfig
impl PathAuthConfig
Sourcepub fn include(self, patterns: Vec<String>) -> Self
pub fn include(self, patterns: Vec<String>) -> Self
Set paths that require authentication 设置需要鉴权的路径
Sourcepub fn exclude(self, patterns: Vec<String>) -> Self
pub fn exclude(self, patterns: Vec<String>) -> Self
Set paths excluded from authentication 设置排除鉴权的路径
Sourcepub fn validator<F>(self, f: F) -> Self
pub fn validator<F>(self, f: F) -> Self
Set a custom login ID validator function 设置自定义的登录ID验证函数
Sourcepub fn validate_login_id(&self, login_id: &str) -> bool
pub fn validate_login_id(&self, login_id: &str) -> bool
Validate a login ID using the configured validator 使用配置的验证器验证登录ID
Trait Implementations§
Source§impl Clone for PathAuthConfig
impl Clone for PathAuthConfig
Source§fn clone(&self) -> PathAuthConfig
fn clone(&self) -> PathAuthConfig
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 PathAuthConfig
impl !RefUnwindSafe for PathAuthConfig
impl Send for PathAuthConfig
impl Sync for PathAuthConfig
impl Unpin for PathAuthConfig
impl !UnwindSafe for PathAuthConfig
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)