pub enum GrantWritePolicy {
Allow,
Warn,
Reject,
}Expand description
注入只读 StpInterface 时,权限/角色写操作的处理策略。
Write policy for permission/role mutations when a read-only
StpInterface is injected.
Variants§
Allow
静默写入 storage,不告警 Write to storage silently; use only when the caller knows the trade-off.
Warn
写入 storage 并输出 tracing::warn!(默认,向后兼容且不静默)
Write to storage and emit a tracing::warn!. Default: compatible, not silent.
Reject
直接拒绝写操作,返回 SaTokenError::ConfigError
Reject the write outright with SaTokenError::ConfigError.
Trait Implementations§
Source§impl Clone for GrantWritePolicy
impl Clone for GrantWritePolicy
Source§fn clone(&self) -> GrantWritePolicy
fn clone(&self) -> GrantWritePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GrantWritePolicy
Source§impl Debug for GrantWritePolicy
impl Debug for GrantWritePolicy
Source§impl Default for GrantWritePolicy
impl Default for GrantWritePolicy
Source§fn default() -> GrantWritePolicy
fn default() -> GrantWritePolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GrantWritePolicy
impl<'de> Deserialize<'de> for GrantWritePolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GrantWritePolicy
Source§impl PartialEq for GrantWritePolicy
impl PartialEq for GrantWritePolicy
Source§impl Serialize for GrantWritePolicy
impl Serialize for GrantWritePolicy
impl StructuralPartialEq for GrantWritePolicy
Auto Trait Implementations§
impl Freeze for GrantWritePolicy
impl RefUnwindSafe for GrantWritePolicy
impl Send for GrantWritePolicy
impl Sync for GrantWritePolicy
impl Unpin for GrantWritePolicy
impl UnsafeUnpin for GrantWritePolicy
impl UnwindSafe for GrantWritePolicy
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