pub struct NamedObjectBase<O>where
    O: ObjectType,
    O::ContentType: BodyContent,
{ /* private fields */ }

Implementations§

source§

impl NamedObjectBase<NamedObjType<ActionDescContent, ActionBodyContent>>

source§

impl NamedObjectBase<NamedObjType<AppGroupDescContent, AppGroupBodyContent>>

source§

impl NamedObjectBase<NamedObjType<ContractDescContent<ContractData>, ContractBodyContent<ContractData>>>

source

pub fn new(
    owner: ObjectId,
    author: ObjectId,
    desc: ContractDescContent<ContractData>,
    body: ContractBodyContent<ContractData>
) -> ContractBuilder

source§

impl NamedObjectBase<NamedObjType<DeviceDescContent, DeviceBodyContent>>

source

pub fn new(
    owner: Option<ObjectId>,
    unique_id: UniqueId,
    endpoints: Vec<Endpoint>,
    sn_list: Vec<DeviceId>,
    passive_pn_list: Vec<DeviceId>,
    public_key: PublicKey,
    area: Area,
    category: DeviceCategory
) -> DeviceBuilder

source

pub fn connect_info(&self) -> &DeviceBodyContent

source

pub fn mut_connect_info(&mut self) -> &mut DeviceBodyContent

source

pub fn name(&self) -> Option<&str>

source

pub fn set_name(&mut self, name: Option<String>)

source

pub fn bdt_version(&self) -> Option<u8>

source

pub fn set_bdt_version(&mut self, bdt_version: Option<u8>)

source

pub fn category(&self) -> BuckyResult<DeviceCategory>

source§

impl NamedObjectBase<NamedObjType<DiffDescContent, DiffBodyContent>>

source

pub fn new(file_id: FileId, diff_list: Vec<ChunkId>) -> DiffBuilder

source§

impl NamedObjectBase<NamedObjType<DirDescContent, DirBodyContent>>

source

pub fn new(
    dir_attributes: Attributes,
    obj_desc: NDNObjectInfo,
    obj_map: HashMap<ObjectId, Vec<u8>>
) -> DirBuilder

source

pub fn new_with_chunk_body(
    dir_attributes: Attributes,
    obj_desc: NDNObjectInfo,
    chunk_body: ChunkId
) -> DirBuilder

source

pub fn get_data_from_body(&self, id: &ObjectId) -> Option<&Vec<u8>>

source

pub fn check_and_fix_desc_limit(&mut self) -> BuckyResult<()>

source§

impl NamedObjectBase<NamedObjType<FileDescContent, FileBodyContent>>

source

pub fn new(
    owner: ObjectId,
    len: u64,
    hash: HashValue,
    chunk_list: ChunkList
) -> FileBuilder

source

pub fn new_no_owner(
    len: u64,
    hash: HashValue,
    chunk_list: ChunkList
) -> FileBuilder

source

pub fn len(&self) -> u64

source

pub fn hash(&self) -> &HashValue

source§

impl<O> NamedObjectBase<O>where
    O: ObjectType,
    O::ContentType: BodyContent,

source

pub fn new_builder(desc: O::DescType) -> NamedObjectBaseBuilder<O>

source

pub fn default(desc: O::DescType) -> Self

source

pub fn new_desc(
    desc: O::DescType,
    signs: ObjectSigns,
    nonce: Option<u128>
) -> Self

source

pub fn split(
    self
) -> (O::DescType, Option<ObjectMutBody<O::ContentType, O>>, ObjectSigns, Option<u128>)

大卸八块,映射成其他类型,Move语义
  • desc: O::DescType,
  • body: Option<ObjectMutBody<O::ContentType, O>>
  • signs: ObjectSigns,
  • nonce: Option,

可进一步对body.unwrap().split()

source

pub fn into_desc(self) -> O::DescType

source

pub fn into_body(self) -> Option<ObjectMutBody<O::ContentType, O>>

source

pub fn get_obj_update_time(&self) -> u64

source§

impl NamedObjectBase<NamedObjType<ObjectMapDescContent, ObjectMapBodyContent>>

source

pub fn new(
    content_type: ObjectMapSimpleContentType,
    owner: Option<ObjectId>,
    dec_id: Option<ObjectId>
) -> ObjectMapBuilder

source

pub fn count(&self) -> u64

source

pub fn object_id(&self) -> ObjectId

source

pub fn content_type(&self) -> ObjectMapSimpleContentType

source

pub fn mode(&self) -> ObjectMapContentMode

source

pub fn class(&self) -> ObjectMapClass

source

pub fn depth(&self) -> u8

source

pub fn metadata(&self) -> ObjectMapMetaData

source

pub fn cached_object_id(&self) -> Option<ObjectId>

source

pub fn direct_set_object_id_on_init(&self, object_id: &ObjectId)

source

pub fn flush_id(&self) -> ObjectId

source

pub fn flush_id_without_cache(&self) -> ObjectId

source

pub async fn convert_to_simple(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef
) -> BuckyResult<()>

source

pub async fn convert_to_hub(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef
) -> BuckyResult<()>

source

pub fn into_simple(self) -> ObjectMapSimpleContent

source

pub async fn get_or_create_child_object_map(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str,
    content_type: ObjectMapSimpleContentType,
    auto_create: ObjectMapCreateStrategy
) -> BuckyResult<Option<ObjectMapRef>>

source

pub async fn list(
    &self,
    cache: &ObjectMapOpEnvCacheRef,
    list: &mut ObjectMapContentList
) -> BuckyResult<u64>

source

pub async fn list_direct(
    &self,
    cache: &ObjectMapOpEnvCacheRef
) -> BuckyResult<ObjectMapContentList>

source

pub async fn list_subs(
    &self,
    cache: &ObjectMapOpEnvCacheRef,
    list: &mut Vec<ObjectId>
) -> BuckyResult<u64>

source

pub async fn next(&self, it: &mut ObjectMapIterator) -> BuckyResult<()>

source

pub async fn get_by_key(
    &self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str
) -> BuckyResult<Option<ObjectId>>

source

pub async fn insert_with_key(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str,
    value: &ObjectId
) -> BuckyResult<()>

source

pub async fn set_with_key(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str,
    value: &ObjectId,
    prev_value: &Option<ObjectId>,
    auto_insert: bool
) -> BuckyResult<Option<ObjectId>>

source

pub async fn remove_with_key(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str,
    prev_value: &Option<ObjectId>
) -> BuckyResult<Option<ObjectId>>

source

pub async fn diff_get_by_key(
    &self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str
) -> BuckyResult<Option<ObjectMapDiffMapItem>>

source

pub async fn diff_insert_with_key(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str,
    value: &ObjectMapDiffMapItem
) -> BuckyResult<()>

source

pub async fn diff_set_with_key(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str,
    value: &ObjectMapDiffMapItem,
    prev_value: &Option<ObjectMapDiffMapItem>,
    auto_insert: bool
) -> BuckyResult<Option<ObjectMapDiffMapItem>>

source

pub async fn diff_remove_with_key(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    key: &str,
    prev_value: &Option<ObjectMapDiffMapItem>
) -> BuckyResult<Option<ObjectMapDiffMapItem>>

source

pub async fn contains(
    &self,
    cache: &ObjectMapOpEnvCacheRef,
    object_id: &ObjectId
) -> BuckyResult<bool>

source

pub async fn insert(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    object_id: &ObjectId
) -> BuckyResult<bool>

source

pub async fn remove(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    object_id: &ObjectId
) -> BuckyResult<bool>

source

pub async fn diff_contains(
    &self,
    cache: &ObjectMapOpEnvCacheRef,
    object_id: &ObjectMapDiffSetItem
) -> BuckyResult<bool>

source

pub async fn diff_insert(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    object_id: &ObjectMapDiffSetItem
) -> BuckyResult<bool>

source

pub async fn diff_remove(
    &mut self,
    cache: &ObjectMapOpEnvCacheRef,
    object_id: &ObjectMapDiffSetItem
) -> BuckyResult<bool>

source

pub async fn visit(&self, visitor: &mut impl ObjectMapVisitor) -> BuckyResult<()>

source§

impl NamedObjectBase<OrgType>

source

pub fn new(members: Vec<OrgMember>, directors: Vec<Director>) -> OrgBuilder

source

pub fn members(&self) -> &Vec<OrgMember>

source

pub fn members_mut(&mut self) -> &mut Vec<OrgMember>

source§

impl NamedObjectBase<NamedObjType<PeopleDescContent, PeopleBodyContent>>

source

pub fn new(
    owner: Option<ObjectId>,
    ood_list: Vec<DeviceId>,
    public_key: PublicKey,
    area: Option<Area>,
    name: Option<String>,
    icon: Option<FileId>
) -> PeopleBuilder

source

pub fn ood_work_mode(&self) -> OODWorkMode

source

pub fn set_ood_work_mode(&mut self, ood_work_mode: OODWorkMode)

source

pub fn ood_list(&self) -> &Vec<DeviceId>

source

pub fn ood_list_mut(&mut self) -> &mut Vec<DeviceId>

source

pub fn name(&self) -> Option<&str>

source

pub fn icon(&self) -> Option<&FileId>

source

pub fn set_name(&mut self, name: String)

source

pub fn set_icon(&mut self, icon: FileId)

source§

impl NamedObjectBase<ProofOfServiceType>

source§

impl NamedObjectBase<NamedObjType<SimpleGroupDescContent, SimpleGroupBodyContent>>

source

pub fn new(
    threshold: u8,
    owners: Vec<PublicKey>,
    members: Vec<ObjectId>,
    ood_work_mode: OODWorkMode,
    ood_list: Vec<DeviceId>,
    area: Area
) -> SimpleGroupBuilder

source§

impl NamedObjectBase<TxType>

交易对象

new 传入 TxBody,注意 TxBody不是 Tx.body(),这个地方的命名有点冲突 new_multi_body 传入 Vec

source

pub fn new(
    nonce: i64,
    caller: TxCaller,
    gas_coin_id: u8,
    gas_price: u16,
    max_fee: u32,
    condition: Option<TxCondition>,
    body: Vec<u8>,
    data: Vec<u8>
) -> TxBuilder

source

pub fn verify_signature(&self, public_key: PublicKey) -> BuckyResult<bool>

source

pub async fn async_verify_signature(
    &self,
    public_key: PublicKey
) -> BuckyResult<bool>

source

pub fn sign(&mut self, secret: &PrivateKey) -> BuckyResult<()>

source§

impl NamedObjectBase<UnionAccountType>

source

pub fn new(
    account1: ObjectId,
    account2: ObjectId,
    service_type: u8
) -> UnionAccountBuilder

Trait Implementations§

source§

impl<O> Clone for NamedObjectBase<O>where
    O: ObjectType + Clone,
    O::ContentType: BodyContent + Clone,
    O::DescType: Clone,

source§

fn clone(&self) -> NamedObjectBase<O>

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<O> Debug for NamedObjectBase<O>where
    O: ObjectType + Debug,
    O::ContentType: BodyContent + Debug,
    O::DescType: Debug,

source§

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

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

impl<O> NamedObject<O> for NamedObjectBase<O>where
    O: ObjectType,
    O::DescType: RawEncodeWithContext<NamedObjectContext>,
    O::ContentType: RawEncode + BodyContent,

source§

fn obj_flags(&self) -> u16

source§

fn desc(&self) -> &O::DescType

source§

fn desc_mut(&mut self) -> &mut O::DescType

source§

fn body(&self) -> &Option<ObjectMutBody<O::ContentType, O>>

source§

fn body_mut(&mut self) -> &mut Option<ObjectMutBody<O::ContentType, O>>

source§

fn signs(&self) -> &ObjectSigns

source§

fn signs_mut(&mut self) -> &mut ObjectSigns

source§

fn nonce(&self) -> &Option<u128>

source§

fn body_expect(&self, msg: &str) -> &ObjectMutBody<O::ContentType, O>

source§

fn body_mut_expect(&mut self, msg: &str) -> &mut ObjectMutBody<O::ContentType, O>

source§

fn latest_update_time(&self) -> u64

source§

impl<O> ObjectFormat for NamedObjectBase<O>where
    O: ObjectType,
    O::DescType: ObjectFormat,
    O::ContentType: BodyContent + ObjectFormat,
    NamedObjectBase<O>: NamedObject<O>,

source§

impl<'de, O> RawDecode<'de> for NamedObjectBase<O>where
    O: ObjectType,
    O::DescType: RawDecodeWithContext<'de, NamedObjectContext>,
    O::ContentType: RawDecode<'de> + BodyContent,

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<O> RawEncode for NamedObjectBase<O>where
    O: ObjectType,
    O::DescType: RawEncodeWithContext<NamedObjectContext>,
    O::ContentType: RawEncode + BodyContent,

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_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§

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 TryFrom<NamedObjectBase<TypelessObjectType<AnyTypeMark>>> for AnyNamedObject

从 TypelessAnyObject 转成 AnyNamedObject

§

type Error = BuckyError

The type returned in the event of a conversion error.
source§

fn try_from(value: TypelessAnyObject) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T, DescContentT, BodyContentT> TryFrom<NamedObjectBase<TypelessObjectType<T>>> for NamedObjectBase<NamedObjType<DescContentT, BodyContentT>>where
    T: TypeCatagoryMark,
    DescContentT: for<'de> RawDecode<'de> + RawEncode + DescContent + Sync + Send + Clone,
    BodyContentT: for<'de> RawDecode<'de> + Sync + Send + Clone + RawEncode + BodyContent,

从 TypelessAnyObject/TypelessCoreObject/TypelessStandardObject/TypelessDECAppObject 转成 具体的强类型

§

type Error = BuckyError

The type returned in the event of a conversion error.
source§

fn try_from(
    value: NamedObjectBase<TypelessObjectType<T>>
) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<O> RefUnwindSafe for NamedObjectBase<O>where
    O: RefUnwindSafe,
    <O as ObjectType>::ContentType: RefUnwindSafe,
    <O as ObjectType>::DescType: RefUnwindSafe,

§

impl<O> Send for NamedObjectBase<O>where
    O: Send,

§

impl<O> Sync for NamedObjectBase<O>where
    O: Sync,

§

impl<O> Unpin for NamedObjectBase<O>where
    O: Unpin,
    <O as ObjectType>::ContentType: Unpin,
    <O as ObjectType>::DescType: Unpin,

§

impl<O> UnwindSafe for NamedObjectBase<O>where
    O: UnwindSafe,
    <O as ObjectType>::ContentType: UnwindSafe,
    <O as ObjectType>::DescType: UnwindSafe,

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