pub struct NamedObjectContext { /* private fields */ }

Implementations§

source§

impl NamedObjectContext

source

pub fn new(obj_type: u16, obj_flags: u16) -> Self

source

pub fn obj_type_code(&self) -> ObjectTypeCode

source

pub fn obj_type(&self) -> u16

source

pub fn obj_flags(&self) -> u16

source

pub fn is_standard_object(&self) -> bool

source

pub fn is_core_object(&self) -> bool

source

pub fn is_decapp_object(&self) -> bool

source

pub fn with_crypto(&mut self) -> &mut Self

source

pub fn has_crypto(&self) -> bool

source

pub fn with_mut_body(&mut self) -> &mut Self

source

pub fn has_mut_body(&self) -> bool

source

pub fn with_desc_signs(&mut self) -> &mut Self

source

pub fn has_desc_signs(&self) -> bool

source

pub fn with_body_signs(&mut self) -> &mut Self

source

pub fn has_body_signs(&self) -> bool

source

pub fn with_nonce(&mut self) -> &mut Self

source

pub fn has_nonce(&self) -> bool

source

pub fn with_dec_id(&mut self) -> &mut Self

source

pub fn has_dec_id(&self) -> bool

source

pub fn with_ref_objects(&mut self) -> &mut Self

source

pub fn has_ref_objects(&self) -> bool

source

pub fn with_prev(&mut self) -> &mut Self

source

pub fn has_prev(&self) -> bool

source

pub fn with_create_timestamp(&mut self) -> &mut Self

source

pub fn has_create_time_stamp(&self) -> bool

source

pub fn with_create_time(&mut self) -> &mut Self

source

pub fn has_create_time(&self) -> bool

source

pub fn with_expired_time(&mut self) -> &mut Self

source

pub fn has_expired_time(&self) -> bool

source

pub fn with_owner(&mut self) -> &mut Self

source

pub fn has_owner(&self) -> bool

source

pub fn with_area(&mut self) -> &mut Self

source

pub fn has_area(&self) -> bool

source

pub fn with_public_key(&mut self) -> &mut Self

source

pub fn has_public_key(&self) -> bool

source

pub fn with_author(&mut self) -> &mut Self

source

pub fn has_author(&self) -> bool

source

pub fn has_ext(&self) -> bool

source

pub fn cache_desc_content_size(&mut self, size: u16) -> &mut Self

source

pub fn get_desc_content_cached_size(&self) -> u16

source

pub fn body_context(&self) -> &NamedObjectBodyContext

source

pub fn mut_body_context(&mut self) -> &mut NamedObjectBodyContext

Trait Implementations§

source§

impl Clone for NamedObjectContext

source§

fn clone(&self) -> NamedObjectContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NamedObjectContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> RawDecode<'de> for NamedObjectContext

source§

fn raw_decode(buf: &'de [u8]) -> BuckyResult<(Self, &'de [u8])>

source§

fn raw_decode_with_option( buf: &'de [u8], _opt: &RawDecodeOption ) -> BuckyResult<(Self, &'de [u8])>

source§

impl<'de> RawDecodeWithContext<'de, &NamedObjectContext> for ObjectSigns

source§

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>,

NamedObjectDesc 的 解码

  • ctx: NamedObjectContext 从上层 NamedObjectBase 里传入编码的上下文
  • 通过 ctx 获取 Option 字段信息
source§

fn raw_decode_with_context( buf: &'de [u8], ctx: NamedObjectContext ) -> BuckyResult<(Self, &'de [u8])>

source§

impl<'de> RawDecodeWithContext<'de, NamedObjectContext> for TypelessObjectDesc

TypelessObjectDesc 解码

  • [1] ctx 部分来自NamedObject里的ctx
  • [2] 其余部分为desc本身的解码
source§

fn raw_decode_with_context( buf: &'de [u8], ctx: NamedObjectContext ) -> BuckyResult<(Self, &'de [u8])>

source§

impl RawEncode for NamedObjectContext

source§

fn raw_measure(&self, _purpose: &Option<RawEncodePurpose>) -> BuckyResult<usize>

source§

fn raw_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>

source§

fn raw_tail_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>

source§

fn raw_encode_to_buffer(&self) -> BuckyResult<Vec<u8>>

source§

fn raw_hash_value(&self) -> BuckyResult<HashValue>

source§

fn hash_buf(&self, encoded_buf: &[u8]) -> HashValue

source§

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,

source§

fn raw_measure_with_context( &self, ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<usize>

source§

fn raw_encode_with_context<'a>( &self, buf: &'a mut [u8], ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>

source§

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,

NamedObjectDesc 的 编码

  • ctx: NamedObjectContext 从上层 NamedObjectBase 里传入编码的上下文
  • 通过 ctx 压缩Option字段的编码
source§

fn raw_measure_with_context( &self, ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<usize>

source§

fn raw_encode_with_context<'a>( &self, buf: &'a mut [u8], ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>

source§

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

source§

fn raw_measure_with_context( &self, ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<usize>

source§

fn raw_encode_with_context<'a>( &self, buf: &'a mut [u8], ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>

source§

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

TypelessObjectDesc 编码

  • [1] ctx 部分来自NamedObject里的ctx
  • [2] 其余部分为desc本身的编码
source§

fn raw_measure_with_context( &self, ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<usize>

source§

fn raw_encode_with_context<'a>( &self, buf: &'a mut [u8], _ctx: &mut NamedObjectContext, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>

source§

fn raw_tail_encode_with_context<'a>( &self, buf: &'a mut [u8], context: &mut Context, purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V