#[non_exhaustive]pub enum SessionError {
EmptyToken,
EmptySubject,
EmptyFingerprint,
UnknownSession,
TokenInUse,
Store(StoreError),
}Expand description
调用方误用,或后端故障向上传递。
错误分界:只有需要校验调用方输入或做安全判定的方法才返回本类型
(bind / rotate);纯委派给 store 的方法(revoke / revoke_all /
purge_expired)没有可误用的输入也不产生判定,直接透出 StoreError。
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
EmptyToken
EmptySubject
EmptyFingerprint
UnknownSession
rotate 的旧 token 不存在、已吊销或已过期,或指纹与本请求不符。
TokenInUse
rotate 的目标 token 已是一个在用会话(未吊销且未过期),
包括 new == old —— 换到同一个 token 语义上自相矛盾,见 rotate。
Store(StoreError)
Trait Implementations§
Source§impl Clone for SessionError
impl Clone for SessionError
Source§impl Debug for SessionError
impl Debug for SessionError
Source§impl Display for SessionError
impl Display for SessionError
impl Eq for SessionError
Source§impl Error for SessionError
impl Error for SessionError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<StoreError> for SessionError
impl From<StoreError> for SessionError
Source§fn from(e: StoreError) -> Self
fn from(e: StoreError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SessionError
impl PartialEq for SessionError
impl StructuralPartialEq for SessionError
Auto Trait Implementations§
impl Freeze for SessionError
impl RefUnwindSafe for SessionError
impl Send for SessionError
impl Sync for SessionError
impl Unpin for SessionError
impl UnsafeUnpin for SessionError
impl UnwindSafe for SessionError
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