Skip to main content

Crate puniyu_account

Crate puniyu_account 

Source
Expand description

§puniyu_account

统一的机器人账户信息类型,描述账号 UIN、昵称与头像数据。

§特性

  • 提供 AccountInfo
  • 提供构建宏 account_info!
  • 支持 serde 序列化与反序列化
  • 提供 AccountInfoBuilder

§示例

use bytes::Bytes;
use puniyu_account::AccountInfo;

let account = AccountInfo {
    uin: "123456789".to_string(),
    name: "Puniyu".to_string(),
    avatar: Bytes::from_static(b"avatar"),
};
assert_eq!(account.uin, "123456789");
use bytes::Bytes;
use puniyu_account::account_info;

let account = account_info!(
    uin: "123456789",
    name: "Puniyu",
    avatar: Bytes::from_static(b"avatar"),
);
assert_eq!(account.name, "Puniyu");

Macros§

account_info
构建机器人账户信息。

Structs§

AccountInfo
机器人账户信息。
AccountInfoBuilder
Use builder syntax to set the inputs and finish with build().