pub struct BotCredential {
pub id: String,
pub secret: String,
pub create_time: u64,
}Expand description
Bot 凭据(botid + secret)。
序列化字段名与旧版凭据文件保持一致(id / secret / create_time),
保证 credentials.enc / bot.enc 的既有密文可继续解密。
Fields§
§id: String§secret: String§create_time: u64Implementations§
Source§impl BotCredential
impl BotCredential
Sourcepub fn new(id: String, secret: String) -> BotCredential
pub fn new(id: String, secret: String) -> BotCredential
Create a new BotCredential with create_time set to the current timestamp.
Trait Implementations§
Source§impl Clone for BotCredential
impl Clone for BotCredential
Source§fn clone(&self) -> BotCredential
fn clone(&self) -> BotCredential
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 BotCredential
impl Debug for BotCredential
Source§impl<'de> Deserialize<'de> for BotCredential
impl<'de> Deserialize<'de> for BotCredential
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BotCredential, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BotCredential, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for BotCredential
impl Serialize for BotCredential
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
Auto Trait Implementations§
impl Freeze for BotCredential
impl RefUnwindSafe for BotCredential
impl Send for BotCredential
impl Sync for BotCredential
impl Unpin for BotCredential
impl UnsafeUnpin for BotCredential
impl UnwindSafe for BotCredential
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