Struct cyfs_base::NamedObjectDesc
source · pub struct NamedObjectDesc<T: DescContent> { /* private fields */ }
Implementations§
source§impl NamedObjectDesc<AppGroupDescContent>
impl NamedObjectDesc<AppGroupDescContent>
pub fn action_id(&self) -> AppGroupId
source§impl NamedObjectDesc<ContractDescContent<ContractData>>
impl NamedObjectDesc<ContractDescContent<ContractData>>
pub fn contract_id(&self) -> ContractId
source§impl<T: DescContent> NamedObjectDesc<T>
impl<T: DescContent> NamedObjectDesc<T>
NamedObjectDesc 行为定义
- new 返回构造器
pub fn new(t: T) -> NamedObjectDescBuilder<T>
pub fn content(&self) -> &T
pub fn content_mut(&mut self) -> &mut T
pub fn into_content(self) -> T
source§impl NamedObjectDesc<ProofOfServiceDescContent<ProofData>>
impl NamedObjectDesc<ProofOfServiceDescContent<ProofData>>
pub fn proof_of_service_id(&self) -> ProofOfServiceId
source§impl NamedObjectDesc<SimpleGroupDescContent>
impl NamedObjectDesc<SimpleGroupDescContent>
pub fn simple_group_id(&self) -> SimpleGroupId
source§impl NamedObjectDesc<TxDescContent<Vec<u8>>>
impl NamedObjectDesc<TxDescContent<Vec<u8>>>
source§impl NamedObjectDesc<UnionAccountDescContent>
impl NamedObjectDesc<UnionAccountDescContent>
pub fn tx_id(&self) -> UnionAccountId
Trait Implementations§
source§impl<T> AreaObjectDesc for NamedObjectDesc<T>where
T: DescContent,
T::AreaType: AreaObjectDesc,
impl<T> AreaObjectDesc for NamedObjectDesc<T>where T: DescContent, T::AreaType: AreaObjectDesc,
NamedObjectDesc 的 AreaObjectDesc 自动实现
如果 T::AreaType 实现了 AreaObjectDesc
则自动为 NamedObjectDesc
source§impl<T> AuthorObjectDesc for NamedObjectDesc<T>where
T: DescContent,
T::AuthorType: AuthorObjectDesc,
impl<T> AuthorObjectDesc for NamedObjectDesc<T>where T: DescContent, T::AuthorType: AuthorObjectDesc,
NamedObjectDesc 的 AuthorObjectDesc 自动实现
如果 T::AuthorType 实现了 AuthorObjectDesc
则自动为 NamedObjectDesc
source§impl<T: Clone + DescContent> Clone for NamedObjectDesc<T>where
T::OwnerType: Clone,
T::AreaType: Clone,
T::AuthorType: Clone,
T::PublicKeyType: Clone,
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>
fn clone(&self) -> NamedObjectDesc<T>
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<T: Debug + DescContent> Debug for NamedObjectDesc<T>where
T::OwnerType: Debug,
T::AreaType: Debug,
T::AuthorType: Debug,
T::PublicKeyType: Debug,
impl<T: Debug + DescContent> Debug for NamedObjectDesc<T>where T::OwnerType: Debug, T::AreaType: Debug, T::AuthorType: Debug, T::PublicKeyType: Debug,
source§impl<T> MNKeyObjectDesc for NamedObjectDesc<T>where
T: DescContent,
T::PublicKeyType: MNKeyObjectDesc,
impl<T> MNKeyObjectDesc for NamedObjectDesc<T>where T: DescContent, T::PublicKeyType: MNKeyObjectDesc,
NamedObjectDesc 的 MNKeyObjectDesc 自动实现
如果 T::PublicKeyType 实现了 MNKeyObjectDesc+PublicKeyObjectDesc 则自动实现了 MNKeyObjectDesc+PublicKeyObjectDesc
fn mn_public_key(&self) -> &MNPublicKey
source§impl<T> ObjectDesc for NamedObjectDesc<T>where
T: DescContent + RawEncode,
T::OwnerType: OwnerObj,
T::AreaType: AreaObj,
T::AuthorType: AuthorObj,
T::PublicKeyType: PublicKeyObj,
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
fn obj_type(&self) -> u16
fn calculate_id(&self) -> ObjectId
fn dec_id(&self) -> &Option<ObjectId>
fn ref_objs(&self) -> &Option<Vec<ObjectLink>>
fn prev(&self) -> &Option<ObjectId>
fn create_timestamp(&self) -> &Option<HashValue>
fn create_time(&self) -> u64
fn option_create_time(&self) -> Option<u64>
fn expired_time(&self) -> Option<u64>
fn obj_type_code(&self) -> ObjectTypeCode
fn is_standard_object(&self) -> bool
fn is_core_object(&self) -> bool
fn is_dec_app_object(&self) -> bool
fn object_id(&self) -> ObjectId
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,
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,
fn format_json(&self) -> Value
source§impl<T> OwnerObjectDesc for NamedObjectDesc<T>where
T: DescContent,
T::OwnerType: OwnerObjectDesc,
impl<T> OwnerObjectDesc for NamedObjectDesc<T>where T: DescContent, T::OwnerType: OwnerObjectDesc,
NamedObjectDesc 的 OwnerObjectDesc 自动实现
如果 T::OwnerType 实现了 OwnerObjectDesc
则自动为 NamedObjectDesc
source§impl<T: PartialEq + DescContent> PartialEq<NamedObjectDesc<T>> for NamedObjectDesc<T>where
T::OwnerType: PartialEq,
T::AreaType: PartialEq,
T::AuthorType: PartialEq,
T::PublicKeyType: PartialEq,
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
fn eq(&self, other: &NamedObjectDesc<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T> PublicKeyObjectDesc for NamedObjectDesc<T>where
T: DescContent,
T::PublicKeyType: PublicKeyObjectDesc,
impl<T> PublicKeyObjectDesc for NamedObjectDesc<T>where T: DescContent, T::PublicKeyType: PublicKeyObjectDesc,
NamedObjectDesc 的 PublicKeyObjectDesc 自动实现
SingleKeyObjectDesc 或者 MNKeyObjectDesc 一旦实现了就一定会实现 PublicKeyObjectDesc
fn public_key_ref(&self) -> Option<PublicKeyRef<'_>>
source§impl<'de, T> RawDecode<'de> for NamedObjectDesc<T>where
T: DescContent + RawDecode<'de>,
impl<'de, T> RawDecode<'de> for NamedObjectDesc<T>where T: DescContent + RawDecode<'de>,
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, 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<T> RawEncode for NamedObjectDesc<T>where
T: DescContent + RawEncode,
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内部整体编码,则由外层保证
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_encode_to_buffer(&self) -> BuckyResult<Vec<u8>>
fn raw_hash_encode(&self) -> BuckyResult<Vec<u8>>
fn raw_tail_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>
fn raw_hash_value(&self) -> BuckyResult<HashValue>
fn hash_buf(&self, encoded_buf: &[u8]) -> HashValue
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<T> SingleKeyObjectDesc for NamedObjectDesc<T>where
T: DescContent,
T::PublicKeyType: SingleKeyObjectDesc,
impl<T> SingleKeyObjectDesc for NamedObjectDesc<T>where T: DescContent, T::PublicKeyType: SingleKeyObjectDesc,
NamedObjectDesc 的 SingleKeyObjectDesc 自动实现
如果 T::PublicKeyType 实现了 SingleKeyObjectDesc+PublicKeyObjectDesc 则自动实现 SingleKeyObjectDesc+PublicKeyObjectDesc