pub struct GenerateOptions {
pub device_info: Option<String>,
pub ip_address: Option<String>,
pub metadata: Option<Value>,
pub family_id: Option<String>,
}Expand description
生成 Refresh Token 的选项
Fields§
§device_info: Option<String>设备信息
ip_address: Option<String>IP 地址
metadata: Option<Value>初始元数据
family_id: Option<String>指定家族 ID(用于在已有家族中生成新 Token)
Implementations§
Source§impl GenerateOptions
impl GenerateOptions
Sourcepub fn with_device_info(self, info: impl Into<String>) -> Self
pub fn with_device_info(self, info: impl Into<String>) -> Self
设置设备信息
Sourcepub fn with_ip_address(self, ip: impl Into<String>) -> Self
pub fn with_ip_address(self, ip: impl Into<String>) -> Self
设置 IP 地址
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
设置初始元数据
Sourcepub fn with_metadata_from<T: Serialize>(self, data: T) -> Self
pub fn with_metadata_from<T: Serialize>(self, data: T) -> Self
设置初始元数据(从可序列化类型)
Sourcepub fn with_family_id(self, family_id: impl Into<String>) -> Self
pub fn with_family_id(self, family_id: impl Into<String>) -> Self
设置家族 ID
Trait Implementations§
Source§impl Clone for GenerateOptions
impl Clone for GenerateOptions
Source§fn clone(&self) -> GenerateOptions
fn clone(&self) -> GenerateOptions
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 GenerateOptions
impl Debug for GenerateOptions
Source§impl Default for GenerateOptions
impl Default for GenerateOptions
Source§fn default() -> GenerateOptions
fn default() -> GenerateOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GenerateOptions
impl RefUnwindSafe for GenerateOptions
impl Send for GenerateOptions
impl Sync for GenerateOptions
impl Unpin for GenerateOptions
impl UnwindSafe for GenerateOptions
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