Struct cyfs_base::NamedObjectContext
source · pub struct NamedObjectContext { /* private fields */ }
Implementations§
source§impl NamedObjectContext
impl NamedObjectContext
pub fn new(obj_type: u16, obj_flags: u16) -> Self
pub fn obj_type_code(&self) -> ObjectTypeCode
pub fn obj_type(&self) -> u16
pub fn obj_flags(&self) -> u16
pub fn is_standard_object(&self) -> bool
pub fn is_core_object(&self) -> bool
pub fn is_decapp_object(&self) -> bool
pub fn with_crypto(&mut self) -> &mut Self
pub fn has_crypto(&self) -> bool
pub fn with_mut_body(&mut self) -> &mut Self
pub fn has_mut_body(&self) -> bool
pub fn with_desc_signs(&mut self) -> &mut Self
pub fn has_desc_signs(&self) -> bool
pub fn with_body_signs(&mut self) -> &mut Self
pub fn has_body_signs(&self) -> bool
pub fn with_nonce(&mut self) -> &mut Self
pub fn has_nonce(&self) -> bool
pub fn with_dec_id(&mut self) -> &mut Self
pub fn has_dec_id(&self) -> bool
pub fn with_ref_objects(&mut self) -> &mut Self
pub fn has_ref_objects(&self) -> bool
pub fn with_prev(&mut self) -> &mut Self
pub fn has_prev(&self) -> bool
pub fn with_create_timestamp(&mut self) -> &mut Self
pub fn has_create_time_stamp(&self) -> bool
pub fn with_create_time(&mut self) -> &mut Self
pub fn has_create_time(&self) -> bool
pub fn with_expired_time(&mut self) -> &mut Self
pub fn has_expired_time(&self) -> bool
pub fn with_owner(&mut self) -> &mut Self
pub fn has_owner(&self) -> bool
pub fn with_area(&mut self) -> &mut Self
pub fn has_area(&self) -> bool
pub fn with_public_key(&mut self) -> &mut Self
pub fn has_public_key(&self) -> bool
pub fn has_ext(&self) -> bool
pub fn cache_desc_content_size(&mut self, size: u16) -> &mut Self
pub fn get_desc_content_cached_size(&self) -> u16
pub fn body_context(&self) -> &NamedObjectBodyContext
pub fn mut_body_context(&mut self) -> &mut NamedObjectBodyContext
Trait Implementations§
source§impl Clone for NamedObjectContext
impl Clone for NamedObjectContext
source§fn clone(&self) -> NamedObjectContext
fn clone(&self) -> NamedObjectContext
Returns a copy of the value. Read more
1.0.0 · 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 NamedObjectContext
impl Debug for NamedObjectContext
source§impl<'de> RawDecode<'de> for NamedObjectContext
impl<'de> RawDecode<'de> for NamedObjectContext
fn raw_decode(buf: &'de [u8]) -> BuckyResult<(Self, &'de [u8])>
fn raw_decode_with_option( buf: &'de [u8], _opt: &RawDecodeOption ) -> BuckyResult<(Self, &'de [u8])>
source§impl<'de> RawDecodeWithContext<'de, &NamedObjectContext> for ObjectSigns
impl<'de> RawDecodeWithContext<'de, &NamedObjectContext> for ObjectSigns
fn raw_decode_with_context( buf: &'de [u8], ctx: &NamedObjectContext ) -> BuckyResult<(Self, &'de [u8])>
source§impl<'de, T> RawDecodeWithContext<'de, NamedObjectContext> for NamedObjectDesc<T>where
T: DescContent + RawDecode<'de>,
impl<'de, T> RawDecodeWithContext<'de, NamedObjectContext> for NamedObjectDesc<T>where T: DescContent + RawDecode<'de>,
NamedObjectDesc 的 解码
- ctx: NamedObjectContext 从上层 NamedObjectBase 里传入编码的上下文
- 通过 ctx 获取 Option 字段信息
fn raw_decode_with_context( buf: &'de [u8], ctx: NamedObjectContext ) -> BuckyResult<(Self, &'de [u8])>
source§impl<'de> RawDecodeWithContext<'de, NamedObjectContext> for TypelessObjectDesc
impl<'de> RawDecodeWithContext<'de, NamedObjectContext> for TypelessObjectDesc
TypelessObjectDesc 解码
- [1] ctx 部分来自NamedObject里的ctx
- [2] 其余部分为desc本身的解码
fn raw_decode_with_context( buf: &'de [u8], ctx: NamedObjectContext ) -> BuckyResult<(Self, &'de [u8])>
source§impl RawEncode for NamedObjectContext
impl RawEncode for NamedObjectContext
fn raw_measure(&self, _purpose: &Option<RawEncodePurpose>) -> BuckyResult<usize>
fn raw_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>
fn raw_tail_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>
fn raw_encode_to_buffer(&self) -> BuckyResult<Vec<u8>>
fn raw_hash_value(&self) -> BuckyResult<HashValue>
fn hash_buf(&self, encoded_buf: &[u8]) -> HashValue
fn raw_hash_encode(&self) -> BuckyResult<Vec<u8>>
source§impl<O> RawEncodeWithContext<NamedObjectContext> for NamedObjectBase<O>where
O: ObjectType,
O::DescType: RawEncodeWithContext<NamedObjectContext>,
O::ContentType: RawEncode + BodyContent,
impl<O> RawEncodeWithContext<NamedObjectContext> for NamedObjectBase<O>where O: ObjectType, O::DescType: RawEncodeWithContext<NamedObjectContext>, O::ContentType: RawEncode + BodyContent,
fn raw_measure_with_context( &self, ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<usize>
fn raw_encode_with_context<'a>( &self, buf: &'a mut [u8], ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>
fn raw_tail_encode_with_context<'a>( &self, buf: &'a mut [u8], context: &mut Context, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>
source§impl<T> RawEncodeWithContext<NamedObjectContext> for NamedObjectDesc<T>where
T: DescContent + RawEncode,
impl<T> RawEncodeWithContext<NamedObjectContext> for NamedObjectDesc<T>where T: DescContent + RawEncode,
NamedObjectDesc 的 编码
- ctx: NamedObjectContext 从上层 NamedObjectBase 里传入编码的上下文
- 通过 ctx 压缩Option字段的编码
fn raw_measure_with_context( &self, ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<usize>
fn raw_encode_with_context<'a>( &self, buf: &'a mut [u8], ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>
fn raw_tail_encode_with_context<'a>( &self, buf: &'a mut [u8], context: &mut Context, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>
source§impl RawEncodeWithContext<NamedObjectContext> for ObjectSigns
impl RawEncodeWithContext<NamedObjectContext> for ObjectSigns
fn raw_measure_with_context( &self, ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<usize>
fn raw_encode_with_context<'a>( &self, buf: &'a mut [u8], ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>
fn raw_tail_encode_with_context<'a>( &self, buf: &'a mut [u8], context: &mut Context, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>
source§impl RawEncodeWithContext<NamedObjectContext> for TypelessObjectDesc
impl RawEncodeWithContext<NamedObjectContext> for TypelessObjectDesc
TypelessObjectDesc 编码
- [1] ctx 部分来自NamedObject里的ctx
- [2] 其余部分为desc本身的编码