pub struct SaTerminalInfo {
pub index: i32,
pub token_value: String,
pub device_type: String,
pub device_id: Option<String>,
pub extra_data: Option<Value>,
pub create_time: i64,
}Expand description
登录设备终端信息
不 derive Eq——extra_data 含 serde_json::Value(浮点数不满足 Eq)
Fields§
§index: i32登录会话索引值:该账号第几个登录的设备,从 1 开始
token_value: String此终端持有的 token 值
device_type: String设备类型,例如 PC / WEB / MOBILE / APP;未指定时为空串
device_id: Option<String>登录设备唯一标识(可选)
extra_data: Option<Value>登录时挂载的扩展数据(只建议登录前设定)
create_time: i64Created-at timestamp (Unix millis). 创建时间(Unix 毫秒)。
Implementations§
Source§impl SaTerminalInfo
impl SaTerminalInfo
Sourcepub fn new(
token_value: impl Into<String>,
device_type: impl Into<String>,
) -> SaTerminalInfo
pub fn new( token_value: impl Into<String>, device_type: impl Into<String>, ) -> SaTerminalInfo
新建终端信息;index 由 SaSession::add_terminal 自动分配,此处传 0 占位即可
Sourcepub fn with_device_id(self, device_id: impl Into<String>) -> SaTerminalInfo
pub fn with_device_id(self, device_id: impl Into<String>) -> SaTerminalInfo
链式设置设备唯一标识
Sourcepub fn with_extra_data(self, extra: Value) -> SaTerminalInfo
pub fn with_extra_data(self, extra: Value) -> SaTerminalInfo
链式设置扩展数据
Sourcepub fn have_extra_data(&self) -> bool
pub fn have_extra_data(&self) -> bool
True when non-empty extra data is set. 是否设置了非空扩展数据。
Trait Implementations§
Source§impl Clone for SaTerminalInfo
impl Clone for SaTerminalInfo
Source§fn clone(&self) -> SaTerminalInfo
fn clone(&self) -> SaTerminalInfo
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 moreSource§impl Debug for SaTerminalInfo
impl Debug for SaTerminalInfo
Source§impl<'de> Deserialize<'de> for SaTerminalInfo
impl<'de> Deserialize<'de> for SaTerminalInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SaTerminalInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SaTerminalInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SaTerminalInfo
impl PartialEq for SaTerminalInfo
Source§impl Serialize for SaTerminalInfo
impl Serialize for SaTerminalInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SaTerminalInfo
Auto Trait Implementations§
impl Freeze for SaTerminalInfo
impl RefUnwindSafe for SaTerminalInfo
impl Send for SaTerminalInfo
impl Sync for SaTerminalInfo
impl Unpin for SaTerminalInfo
impl UnsafeUnpin for SaTerminalInfo
impl UnwindSafe for SaTerminalInfo
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more