Companion

expect object Companion
actual object Companion

Functions

Link copied to clipboard

将通过 serializeToString 序列化得到的字符串反序列化为 DeviceInfo. 此函数兼容旧版 mirai 序列化的字符串.

将通过 serializeToString 序列化得到的字符串反序列化为 DeviceInfo. 此函数兼容旧版 mirai 序列化的字符串.

Link copied to clipboard
fun <Error class: unknown class>.loadAsDeviceInfo(json: Json = DeviceInfoManager.format): DeviceInfo

加载一个设备信息. 若文件不存在或为空则随机并创建一个设备信息保存.

Link copied to clipboard

生成随机 DeviceInfo

expect fun random(random: Random): DeviceInfo

使用特定随机数生成器生成 DeviceInfo

actual fun random(): DeviceInfo

生成随机 DeviceInfo

actual fun random(random: Random): DeviceInfo

使用特定随机数生成器生成 DeviceInfo

Link copied to clipboard
expect fun serializer(): KSerializer<DeviceInfo>
Link copied to clipboard
expect fun serializeToString(deviceInfo: DeviceInfo): String

将此 DeviceInfo 序列化为字符串. 序列化的字符串可以在以后通过 DeviceInfo.deserializeFromString 反序列化为 DeviceInfo.

actual fun serializeToString(deviceInfo: DeviceInfo): String

将此 DeviceInfo 序列化为字符串. 序列化的字符串可以在以后通过 DeviceInfo.deserializeFromString 反序列化为 DeviceInfo.