pub struct NamedObjectDesc<T: DescContent> { /* private fields */ }

Implementations§

source§

impl NamedObjectDesc<ActionDescContent>

source

pub fn action_id(&self) -> ActionId

source§

impl NamedObjectDesc<AppGroupDescContent>

source

pub fn action_id(&self) -> AppGroupId

source§

impl NamedObjectDesc<ContractDescContent<ContractData>>

source

pub fn contract_id(&self) -> ContractId

source§

impl NamedObjectDesc<DeviceDescContent>

source

pub fn device_id(&self) -> DeviceId

source

pub fn unique_id(&self) -> &UniqueId

source§

impl NamedObjectDesc<DiffDescContent>

source

pub fn diff_id(&self) -> DiffId

source§

impl NamedObjectDesc<DirDescContent>

source

pub fn dir_id(&self) -> DirId

source§

impl NamedObjectDesc<FileDescContent>

source

pub fn file_id(&self) -> FileId

source§

impl<T: DescContent> NamedObjectDesc<T>

NamedObjectDesc 行为定义

  • new 返回构造器
source

pub fn new(t: T) -> NamedObjectDescBuilder<T>

source

pub fn content(&self) -> &T

source

pub fn content_mut(&mut self) -> &mut T

source

pub fn into_content(self) -> T

source§

impl NamedObjectDesc<OrgDescContent>

source

pub fn action_id(&self) -> OrgId

source§

impl NamedObjectDesc<PeopleDescContent>

source

pub fn people_id(&self) -> PeopleId

source§

impl NamedObjectDesc<ProofOfServiceDescContent<ProofData>>

source§

impl NamedObjectDesc<SimpleGroupDescContent>

source§

impl NamedObjectDesc<TxDescContent<Vec<u8>>>

source

pub fn tx_id(&self) -> TxId

source§

impl NamedObjectDesc<UnionAccountDescContent>

source

pub fn tx_id(&self) -> UnionAccountId

Trait Implementations§

source§

impl<T> AreaObjectDesc for NamedObjectDesc<T>where T: DescContent, T::AreaType: AreaObjectDesc,

NamedObjectDesc 的 AreaObjectDesc 自动实现

如果 T::AreaType 实现了 AreaObjectDesc 则自动为 NamedObjectDesc 实现 AreaObjectDesc

source§

fn area(&self) -> &Option<Area>

source§

impl<T> AuthorObjectDesc for NamedObjectDesc<T>where T: DescContent, T::AuthorType: AuthorObjectDesc,

NamedObjectDesc 的 AuthorObjectDesc 自动实现

如果 T::AuthorType 实现了 AuthorObjectDesc 则自动为 NamedObjectDesc 实现 AuthorObjectDesc

source§

impl<T: Clone + DescContent> Clone for NamedObjectDesc<T>where T::OwnerType: Clone, T::AreaType: Clone, T::AuthorType: Clone, T::PublicKeyType: Clone,

source§

fn clone(&self) -> NamedObjectDesc<T>

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<T: Debug + DescContent> Debug for NamedObjectDesc<T>where T::OwnerType: Debug, T::AreaType: Debug, T::AuthorType: Debug, T::PublicKeyType: Debug,

source§

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

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

impl<T> MNKeyObjectDesc for NamedObjectDesc<T>where T: DescContent, T::PublicKeyType: MNKeyObjectDesc,

NamedObjectDesc 的 MNKeyObjectDesc 自动实现

如果 T::PublicKeyType 实现了 MNKeyObjectDesc+PublicKeyObjectDesc 则自动实现了 MNKeyObjectDesc+PublicKeyObjectDesc

source§

impl<T> ObjectDesc for NamedObjectDesc<T>where T: DescContent + RawEncode, T::OwnerType: OwnerObj, T::AreaType: AreaObj, T::AuthorType: AuthorObj, T::PublicKeyType: PublicKeyObj,

NamedObjectDesc 的 ObjectDesc 自动实现

对任意 T: DescContent 为 NamedObjectDesc 实现 ObjectDesc

source§

impl<T> ObjectFormat for NamedObjectDesc<T>where T: DescContent + ObjectFormat, T::OwnerType: OwnerObj, T::AreaType: AreaObj, T::AuthorType: AuthorObj, T::PublicKeyType: PublicKeyObj, NamedObjectDesc<T>: ObjectDesc + OwnerObjectDesc + AreaObjectDesc + AuthorObjectDesc + PublicKeyObjectDesc,

source§

impl<T> OwnerObjectDesc for NamedObjectDesc<T>where T: DescContent, T::OwnerType: OwnerObjectDesc,

NamedObjectDesc 的 OwnerObjectDesc 自动实现

如果 T::OwnerType 实现了 OwnerObjectDesc 则自动为 NamedObjectDesc 实现 OwnerObjectDesc

source§

impl<T: PartialEq + DescContent> PartialEq<NamedObjectDesc<T>> for NamedObjectDesc<T>where T::OwnerType: PartialEq, T::AreaType: PartialEq, T::AuthorType: PartialEq, T::PublicKeyType: PartialEq,

source§

fn eq(&self, other: &NamedObjectDesc<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PublicKeyObjectDesc for NamedObjectDesc<T>where T: DescContent, T::PublicKeyType: PublicKeyObjectDesc,

NamedObjectDesc 的 PublicKeyObjectDesc 自动实现

SingleKeyObjectDesc 或者 MNKeyObjectDesc 一旦实现了就一定会实现 PublicKeyObjectDesc

source§

impl<'de, T> RawDecode<'de> for NamedObjectDesc<T>where T: DescContent + RawDecode<'de>,

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, 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<T> RawEncode for NamedObjectDesc<T>where T: DescContent + RawEncode,

NamedObjectDesc 独立编解码,需要包含obj_type+obj_flags信息

  • [1] ctx 部分包含obj_type, obj_flags 信息(前5bits为0,区别于NamedObject里的ctx.obj_flags)
  • [2] 其余部分为desc本身的编码 需要注意Desc部分独立编码,需要在头部编码正确的NamedObjectContext;如果在NamedObject内部整体编码,则由外层保证
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_encode_to_buffer(&self) -> BuckyResult<Vec<u8>>

source§

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

source§

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

source§

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

source§

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

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<T> SingleKeyObjectDesc for NamedObjectDesc<T>where T: DescContent, T::PublicKeyType: SingleKeyObjectDesc,

NamedObjectDesc 的 SingleKeyObjectDesc 自动实现

如果 T::PublicKeyType 实现了 SingleKeyObjectDesc+PublicKeyObjectDesc 则自动实现 SingleKeyObjectDesc+PublicKeyObjectDesc

source§

impl<T: DescContent> StructuralPartialEq for NamedObjectDesc<T>

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