pub trait DescContent {
type OwnerType: OwnerObj;
type AreaType: AreaObj;
type AuthorType: AuthorObj;
type PublicKeyType: PublicKeyObj;
// Required method
fn obj_type() -> u16;
// Provided methods
fn obj_type_code() -> ObjectTypeCode { ... }
fn desc_content_type() -> DescContentType { ... }
fn is_standard_object() -> bool { ... }
fn is_core_object() -> bool { ... }
fn is_decapp_object() -> bool { ... }
fn debug_info() -> String { ... }
fn version(&self) -> u8 { ... }
fn format(&self) -> u8 { ... }
}
Expand description
§DescContent
Desc的用户自定义部分接口定义
- 提供 fn obj_type() -> u16
- 如果想要实现解码的向前兼容,提供 fn version() -> u16
- 提供 OwnerType/AreaType/AuthorType/PublicKeyType 类型
- 指定 SubDescNone 表示不提供该特性
- 否则指定 其他四种 SubDescType, 参考上面 SubDescType 的说明
Required Associated Types§
type OwnerType: OwnerObj
type AreaType: AreaObj
type AuthorType: AuthorObj
type PublicKeyType: PublicKeyObj
Required Methods§
Provided Methods§
fn obj_type_code() -> ObjectTypeCode
fn desc_content_type() -> DescContentType
fn is_standard_object() -> bool
fn is_core_object() -> bool
fn is_decapp_object() -> bool
fn debug_info() -> String
fn version(&self) -> u8
fn format(&self) -> u8
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.