pub struct NamedObjectId<T: ObjectType>(/* private fields */);
Expand description
§强类型命名对象Id
手工实现PartialEq、Eq、PartialOrd、Ord,附加的类型上并不需要实现这四个Trait 转发这四个Trait的实现给内部的ObjectId
Implementations§
Source§impl NamedObjectId<NamedObjType<ContractDescContent<ContractData>, ContractBodyContent<ContractData>>>
impl NamedObjectId<NamedObjType<ContractDescContent<ContractData>, ContractBodyContent<ContractData>>>
pub fn from_hash_256(hash: GenericArray<u8, U32>) -> Self
Source§impl<T: ObjectType> NamedObjectId<T>
impl<T: ObjectType> NamedObjectId<T>
Trait Implementations§
Source§impl<T: ObjectType> AsRef<ObjectId> for NamedObjectId<T>
impl<T: ObjectType> AsRef<ObjectId> for NamedObjectId<T>
Source§impl<T: Clone + ObjectType> Clone for NamedObjectId<T>
impl<T: Clone + ObjectType> Clone for NamedObjectId<T>
Source§fn clone(&self) -> NamedObjectId<T>
fn clone(&self) -> NamedObjectId<T>
Returns a duplicate 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: ObjectType> Debug for NamedObjectId<T>
impl<T: ObjectType> Debug for NamedObjectId<T>
Source§impl<T: ObjectType> Default for NamedObjectId<T>
impl<T: ObjectType> Default for NamedObjectId<T>
Source§impl<'de, T: ObjectType> Deserialize<'de> for NamedObjectId<T>
impl<'de, T: ObjectType> Deserialize<'de> for NamedObjectId<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: ObjectType> Display for NamedObjectId<T>
impl<T: ObjectType> Display for NamedObjectId<T>
Source§impl<T: ObjectType> FromStr for NamedObjectId<T>
impl<T: ObjectType> FromStr for NamedObjectId<T>
Source§impl<T: ObjectType> Hash for NamedObjectId<T>
impl<T: ObjectType> Hash for NamedObjectId<T>
Source§impl<T: ObjectType> Into<ObjectId> for NamedObjectId<T>
impl<T: ObjectType> Into<ObjectId> for NamedObjectId<T>
Source§impl<T: ObjectType> Ord for NamedObjectId<T>
impl<T: ObjectType> Ord for NamedObjectId<T>
Source§impl<T: ObjectType> PartialEq<NamedObjectId<T>> for ObjectId
impl<T: ObjectType> PartialEq<NamedObjectId<T>> for ObjectId
Source§impl<T: ObjectType> PartialEq<ObjectId> for NamedObjectId<T>
impl<T: ObjectType> PartialEq<ObjectId> for NamedObjectId<T>
Source§impl<T: ObjectType> PartialEq for NamedObjectId<T>
impl<T: ObjectType> PartialEq for NamedObjectId<T>
Source§impl<T: ObjectType> PartialOrd for NamedObjectId<T>
impl<T: ObjectType> PartialOrd for NamedObjectId<T>
Source§impl<T: ObjectType> ProtobufTransform<&NamedObjectId<T>> for Vec<u8>
impl<T: ObjectType> ProtobufTransform<&NamedObjectId<T>> for Vec<u8>
fn transform(value: &NamedObjectId<T>) -> BuckyResult<Self>
Source§impl<T: ObjectType> ProtobufTransform<Vec<u8>> for NamedObjectId<T>
impl<T: ObjectType> ProtobufTransform<Vec<u8>> for NamedObjectId<T>
Source§impl<'de, T: ObjectType> RawDecode<'de> for NamedObjectId<T>
impl<'de, T: ObjectType> RawDecode<'de> for NamedObjectId<T>
fn raw_decode(buf: &'de [u8]) -> Result<(Self, &'de [u8]), BuckyError>
fn raw_decode_with_option( buf: &'de [u8], _opt: &RawDecodeOption, ) -> BuckyResult<(Self, &'de [u8])>
Source§impl<T: ObjectType> RawDiff for NamedObjectId<T>
impl<T: ObjectType> RawDiff for NamedObjectId<T>
fn diff_measure(&self, right: &Self) -> BuckyResult<usize>
fn diff<'d>(&self, right: &Self, buf: &'d mut [u8]) -> BuckyResult<&'d mut [u8]>
Source§impl<T: ObjectType> RawEncode for NamedObjectId<T>
impl<T: ObjectType> RawEncode for NamedObjectId<T>
fn raw_measure( &self, purpose: &Option<RawEncodePurpose>, ) -> Result<usize, BuckyError>
fn raw_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose>, ) -> Result<&'a mut [u8], BuckyError>
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<T: ObjectType> RawFixedBytes for NamedObjectId<T>
impl<T: ObjectType> RawFixedBytes for NamedObjectId<T>
Source§impl<'de, T: ObjectType> RawPatch<'de> for NamedObjectId<T>
impl<'de, T: ObjectType> RawPatch<'de> for NamedObjectId<T>
Source§impl<T: ObjectType> Serialize for NamedObjectId<T>
impl<T: ObjectType> Serialize for NamedObjectId<T>
Source§impl<T: ObjectType> TryFrom<&ObjectId> for NamedObjectId<T>
impl<T: ObjectType> TryFrom<&ObjectId> for NamedObjectId<T>
Source§impl<T: ObjectType> TryFrom<ObjectId> for NamedObjectId<T>
impl<T: ObjectType> TryFrom<ObjectId> for NamedObjectId<T>
impl<T: Copy + ObjectType> Copy for NamedObjectId<T>
impl<T: ObjectType> Eq for NamedObjectId<T>
Auto Trait Implementations§
impl<T> Freeze for NamedObjectId<T>
impl<T> RefUnwindSafe for NamedObjectId<T>where
T: RefUnwindSafe,
impl<T> Send for NamedObjectId<T>where
T: Send,
impl<T> Sync for NamedObjectId<T>where
T: Sync,
impl<T> Unpin for NamedObjectId<T>where
T: Unpin,
impl<T> UnwindSafe for NamedObjectId<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, D> FileDecoder<'de> for Dwhere
D: RawDecode<'de>,
impl<'de, D> FileDecoder<'de> for Dwhere
D: RawDecode<'de>,
fn decode_from_file( file: &Path, buf: &'de mut Vec<u8>, ) -> Result<(D, usize), BuckyError>
Source§impl<D> FileEncoder<D> for Dwhere
D: RawEncode,
impl<D> FileEncoder<D> for Dwhere
D: RawEncode,
fn suggest_buffer_size(&self) -> Result<usize, BuckyError>
fn encode<'a>( &self, buf: &'a mut [u8], _is_compress: bool, ) -> Result<&'a mut [u8], BuckyError>
fn encode_to_writer( &self, writer: impl Write, is_compress: bool, ) -> BuckyResult<usize>
fn encode_to_file(&self, file: &Path, is_compress: bool) -> BuckyResult<usize>
fn encode_to_vec(&self, is_compress: bool) -> BuckyResult<Vec<u8>>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more