pub struct Identifier(pub IdentifierBytes32);Tuple Fields§
§0: IdentifierBytes32Implementations§
Source§impl Identifier
impl Identifier
pub const fn new(buffer: [u8; 32]) -> Identifier
pub fn random() -> Identifier
pub fn random_with_rng(rng: &mut StdRng) -> Identifier
pub fn as_bytes(&self) -> &[u8; 32]
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn from_string( encoded_value: &str, encoding: Encoding, ) -> Result<Identifier, Error>
pub fn from_string_try_encodings( encoded_value: &str, encodings: &[Encoding], ) -> Result<Identifier, Error>
pub fn from_string_unknown_encoding( encoded_value: &str, ) -> Result<Identifier, Error>
pub fn from_string_with_encoding_string( encoded_value: &str, encoding_string: Option<&str>, ) -> Result<Identifier, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Identifier, Error>
pub fn from_vec(vec: Vec<u8>) -> Result<Identifier, Error>
pub fn to_json_value_vec(&self) -> Vec<JsonValue>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn to_buffer(&self) -> [u8; 32]
pub fn into_buffer(self) -> [u8; 32]
pub fn to_string(&self, encoding: Encoding) -> String
pub fn to_string_with_encoding_string( &self, encoding_string: Option<&str>, ) -> String
Trait Implementations§
Source§impl AsRef<[u8]> for Identifier
impl AsRef<[u8]> for Identifier
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Identifier
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Identifier
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for Identifier
impl Clone for Identifier
Source§fn clone(&self) -> Identifier
fn clone(&self) -> Identifier
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 Debug for Identifier
impl Debug for Identifier
Source§impl<__Context> Decode<__Context> for Identifier
impl<__Context> Decode<__Context> for Identifier
Source§impl Default for Identifier
impl Default for Identifier
Source§fn default() -> Identifier
fn default() -> Identifier
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Identifier
impl<'de> Deserialize<'de> for Identifier
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 Display for Identifier
impl Display for Identifier
Source§impl Distribution<Identifier> for Standard
impl Distribution<Identifier> for Standard
Source§impl Encode for Identifier
impl Encode for Identifier
Source§impl From<&Identifier> for String
impl From<&Identifier> for String
Source§fn from(val: &Identifier) -> Self
fn from(val: &Identifier) -> Self
Converts to this type from the input type.
Source§impl From<&Identifier> for Value
impl From<&Identifier> for Value
Source§fn from(value: &Identifier) -> Self
fn from(value: &Identifier) -> Self
Converts to this type from the input type.
Source§impl From<Identifier> for [u8; 32]
impl From<Identifier> for [u8; 32]
Source§fn from(id: Identifier) -> Self
fn from(id: Identifier) -> Self
Converts to this type from the input type.
Source§impl From<Identifier> for String
impl From<Identifier> for String
Source§fn from(val: Identifier) -> Self
fn from(val: Identifier) -> Self
Converts to this type from the input type.
Source§impl From<Identifier> for Value
impl From<Identifier> for Value
Source§fn from(value: Identifier) -> Self
fn from(value: Identifier) -> Self
Converts to this type from the input type.
Source§impl Hash for Identifier
impl Hash for Identifier
Source§impl Ord for Identifier
impl Ord for Identifier
Source§fn cmp(&self, other: &Identifier) -> Ordering
fn cmp(&self, other: &Identifier) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<&Identifier> for Identifier
impl PartialEq<&Identifier> for Identifier
Source§impl PartialEq for Identifier
impl PartialEq for Identifier
Source§impl PartialOrd for Identifier
impl PartialOrd for Identifier
Source§impl PlatformVersionEncode for Identifier
impl PlatformVersionEncode for Identifier
Source§fn platform_encode<E: Encoder>(
&self,
encoder: &mut E,
_: &PlatformVersion,
) -> Result<(), EncodeError>
fn platform_encode<E: Encoder>( &self, encoder: &mut E, _: &PlatformVersion, ) -> Result<(), EncodeError>
Encode a given type.
Source§impl PlatformVersionedDecode for Identifier
impl PlatformVersionedDecode for Identifier
Source§fn platform_versioned_decode<D: Decoder>(
decoder: &mut D,
_platform_version: &PlatformVersion,
) -> Result<Self, DecodeError>
fn platform_versioned_decode<D: Decoder>( decoder: &mut D, _platform_version: &PlatformVersion, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given Decode.
Source§impl Serialize for Identifier
impl Serialize for Identifier
Source§impl TryFrom<&[u8]> for Identifier
impl TryFrom<&[u8]> for Identifier
Source§impl TryFrom<&Value> for Identifier
impl TryFrom<&Value> for Identifier
Source§impl TryFrom<String> for Identifier
impl TryFrom<String> for Identifier
Source§impl TryFrom<Value> for Identifier
impl TryFrom<Value> for Identifier
impl Copy for Identifier
impl Eq for Identifier
impl StructuralPartialEq for Identifier
Auto Trait Implementations§
impl Freeze for Identifier
impl RefUnwindSafe for Identifier
impl Send for Identifier
impl Sync for Identifier
impl Unpin for Identifier
impl UnwindSafe for Identifier
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<'de, T> DefaultBorrowDecode<'de> for Twhere
T: BorrowDecode<'de, ()>,
impl<'de, T> DefaultBorrowDecode<'de> for Twhere
T: BorrowDecode<'de, ()>,
fn borrow_decode<D>(decoder: &mut D) -> Result<Self, DecodeError>
§impl<T> DefaultDecode for T
impl<T> DefaultDecode for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T, U> IntoPlatformVersioned<U> for Twhere
U: FromPlatformVersioned<T>,
impl<T, U> IntoPlatformVersioned<U> for Twhere
U: FromPlatformVersioned<T>,
§fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U
fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U
Performs the conversion.
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)§impl<T, U> TryIntoPlatformVersioned<U> for Twhere
U: TryFromPlatformVersioned<T>,
impl<T, U> TryIntoPlatformVersioned<U> for Twhere
U: TryFromPlatformVersioned<T>,
§type Error = <U as TryFromPlatformVersioned<T>>::Error
type Error = <U as TryFromPlatformVersioned<T>>::Error
The type returned in the event of a conversion error.
§fn try_into_platform_versioned(
self,
platform_version: &PlatformVersion,
) -> Result<U, <U as TryFromPlatformVersioned<T>>::Error>
fn try_into_platform_versioned( self, platform_version: &PlatformVersion, ) -> Result<U, <U as TryFromPlatformVersioned<T>>::Error>
Performs the conversion.
§impl<T, U> TryIntoVersioned<U> for Twhere
U: TryFromVersioned<T>,
impl<T, U> TryIntoVersioned<U> for Twhere
U: TryFromVersioned<T>,
§type Error = <U as TryFromVersioned<T>>::Error
type Error = <U as TryFromVersioned<T>>::Error
The type returned in the event of a conversion error.
§fn try_into_versioned(
self,
grove_version: &GroveVersion,
) -> Result<U, <U as TryFromVersioned<T>>::Error>
fn try_into_versioned( self, grove_version: &GroveVersion, ) -> Result<U, <U as TryFromVersioned<T>>::Error>
Performs the conversion.