pub struct SessionUser {
pub id: i32,
pub username: String,
pub email: String,
pub role: UserRole,
pub created_at: DateTime<Utc>,
pub session_generation: i32,
}Expand description
会话缓存使用的轻量用户结构体,不含密码哈希。
Fields§
§id: i32用户主键。
username: String用户名。
email: String邮箱地址。
role: UserRole用户角色。
created_at: DateTime<Utc>账户创建时间。
session_generation: i32会话世代号,签发 session 时记录;与 users 表当前值不一致则 session 失效。
Trait Implementations§
Source§impl Clone for SessionUser
impl Clone for SessionUser
Source§fn clone(&self) -> SessionUser
fn clone(&self) -> SessionUser
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 SessionUser
impl Debug for SessionUser
Source§impl<'de> Deserialize<'de> for SessionUser
impl<'de> Deserialize<'de> for SessionUser
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
Source§impl From<SessionUser> for PublicUser
impl From<SessionUser> for PublicUser
Source§fn from(u: SessionUser) -> Self
fn from(u: SessionUser) -> Self
将 SessionUser 转换为 PublicUser。
Source§impl PartialEq for SessionUser
impl PartialEq for SessionUser
Source§impl Serialize for SessionUser
impl Serialize for SessionUser
impl StructuralPartialEq for SessionUser
Auto Trait Implementations§
impl Freeze for SessionUser
impl RefUnwindSafe for SessionUser
impl Send for SessionUser
impl Sync for SessionUser
impl Unpin for SessionUser
impl UnsafeUnpin for SessionUser
impl UnwindSafe for SessionUser
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
§impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
§fn transport_to_bytes(&self) -> Vec<u8> ⓘ
fn transport_to_bytes(&self) -> Vec<u8> ⓘ
Serialize the type to a byte vector for transport
§fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
Deserialize the type from a byte slice