Skip to main content

LocalOnlineStore

Struct LocalOnlineStore 

Source
pub struct LocalOnlineStore { /* private fields */ }
Expand description

Process-local store (explicit single-node / tests). 进程内存储(显式单机 / 测试)。

Implementations§

Source§

impl LocalOnlineStore

Source

pub fn new() -> Self

Create a new instance | 创建新实例

Trait Implementations§

Source§

impl Debug for LocalOnlineStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LocalOnlineStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl OnlineStore for LocalOnlineStore

Source§

fn mark_online<'life0, 'async_trait>( &'life0 self, user: OnlineUser, ) -> Pin<Box<dyn Future<Output = SaTokenResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Mark a user connection online | 标记用户连接在线
Source§

fn mark_offline<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, login_type: &'life1 str, login_id: &'life2 str, token: &'life3 str, ) -> Pin<Box<dyn Future<Output = SaTokenResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

mark_offline — mark offline | mark_offline
Source§

fn mark_offline_all<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, login_type: &'life1 str, login_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = SaTokenResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Mark all connections offline | 标记该账号全部离线
Source§

fn is_online<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, login_type: &'life1 str, login_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = SaTokenResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Whether the login id is online | 登录 ID 是否在线
Source§

fn get_online_count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = SaTokenResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

get_online_count — get online count | get_online_count
Source§

fn get_online_users<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = SaTokenResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List online users for a login id | 列出某登录 ID 的在线用户
Source§

fn get_user_sessions<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, login_type: &'life1 str, login_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = SaTokenResult<Vec<OnlineUser>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

get_user_sessions — get user sessions | get_user_sessions
Source§

fn update_activity<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, login_type: &'life1 str, login_id: &'life2 str, token: &'life3 str, ) -> Pin<Box<dyn Future<Output = SaTokenResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Refresh last-activity timestamp | 刷新最近活跃时间
Source§

fn prune_index<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _login_type: &'life1 str, _login_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = SaTokenResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Drop index members whose record key is gone (TTL or crash). 丢掉记录键已消失的索引成员(TTL 或异常退出)。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ForyObject for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more