pub trait RawDecodeWithContext<'de, Context>: Sized {
// Required method
fn raw_decode_with_context(
buf: &'de [u8],
_: Context,
) -> BuckyResult<(Self, &'de [u8])>;
}
Required Methods§
fn raw_decode_with_context( buf: &'de [u8], _: Context, ) -> BuckyResult<(Self, &'de [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.
Implementors§
impl<'de> RawDecodeWithContext<'de, &NamedObjectContext> for ObjectSigns
impl<'de> RawDecodeWithContext<'de, NamedObjectContext> for TypelessObjectDesc
§TypelessObjectDesc 解码
- [1] ctx 部分来自NamedObject里的ctx
- [2] 其余部分为desc本身的解码
impl<'de, B, O> RawDecodeWithContext<'de, &NamedObjectBodyContext> for ObjectMutBody<B, O>
impl<'de, T> RawDecodeWithContext<'de, NamedObjectContext> for NamedObjectDesc<T>where
T: DescContent + RawDecode<'de>,
§NamedObjectDesc 的 解码
- ctx: NamedObjectContext 从上层 NamedObjectBase 里传入编码的上下文
- 通过 ctx 获取 Option 字段信息