Struct aleo_rust::snarkvm_types::Identifier
pub struct Identifier<N>(/* private fields */)
where
N: Network;
Expand description
An identifier is an immutable UTF-8 string, represented as a constant field element in the CurrentNetwork.
§Requirements
The identifier must not be an empty string. The identifier must not start with a number. The identifier must be alphanumeric, and may include underscores. The identifier must not consist solely of underscores. The identifier must fit within the data capacity of a base field element.
Implementations§
§impl<N> Identifier<N>where
N: Network,
impl<N> Identifier<N>where
N: Network,
pub fn size_in_bits(&self) -> u8
pub fn size_in_bits(&self) -> u8
Returns the number of bits of this identifier.
Trait Implementations§
§impl<N> Clone for Identifier<N>
impl<N> Clone for Identifier<N>
§fn clone(&self) -> Identifier<N>
fn clone(&self) -> Identifier<N>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<N> Debug for Identifier<N>where
N: Network,
impl<N> Debug for Identifier<N>where
N: Network,
§impl<'de, N> Deserialize<'de> for Identifier<N>where
N: Network,
impl<'de, N> Deserialize<'de> for Identifier<N>where
N: Network,
§fn deserialize<D>(
deserializer: D
) -> Result<Identifier<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Identifier<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the identifier from a string or bytes.
§impl<N> Display for Identifier<N>where
N: Network,
impl<N> Display for Identifier<N>where
N: Network,
§impl<N> Equal for Identifier<N>where
N: Network,
impl<N> Equal for Identifier<N>where
N: Network,
§fn is_equal(&self, other: &Identifier<N>) -> <Identifier<N> as Equal>::Output
fn is_equal(&self, other: &Identifier<N>) -> <Identifier<N> as Equal>::Output
Returns true
if self
and other
are equal.
§fn is_not_equal(
&self,
other: &Identifier<N>
) -> <Identifier<N> as Equal>::Output
fn is_not_equal( &self, other: &Identifier<N> ) -> <Identifier<N> as Equal>::Output
Returns true
if self
and other
are not equal.
type Output = Boolean<N>
§impl<N> From<&Identifier<N>> for Identifier<N>where
N: Network,
impl<N> From<&Identifier<N>> for Identifier<N>where
N: Network,
§fn from(identifier: &Identifier<N>) -> Identifier<N>
fn from(identifier: &Identifier<N>) -> Identifier<N>
Returns a copy of the identifier.
§impl<N> From<Identifier<N>> for PlaintextType<N>where
N: Network,
impl<N> From<Identifier<N>> for PlaintextType<N>where
N: Network,
§fn from(struct_: Identifier<N>) -> PlaintextType<N>
fn from(struct_: Identifier<N>) -> PlaintextType<N>
Initializes a plaintext type from a struct type.
§impl<N> FromBits for Identifier<N>where
N: Network,
impl<N> FromBits for Identifier<N>where
N: Network,
§fn from_bits_le(bits_le: &[bool]) -> Result<Identifier<N>, Error>
fn from_bits_le(bits_le: &[bool]) -> Result<Identifier<N>, Error>
Initializes a new identifier from a list of little-endian bits without trailing zeros.
§fn from_bits_be(bits_be: &[bool]) -> Result<Identifier<N>, Error>
fn from_bits_be(bits_be: &[bool]) -> Result<Identifier<N>, Error>
Initializes a new identifier from a list of big-endian bits without leading zeros.
§impl<N> FromBytes for Identifier<N>where
N: Network,
impl<N> FromBytes for Identifier<N>where
N: Network,
§impl<N> FromField for Identifier<N>where
N: Network,
impl<N> FromField for Identifier<N>where
N: Network,
§fn from_field(
field: &<Identifier<N> as FromField>::Field
) -> Result<Identifier<N>, Error>
fn from_field( field: &<Identifier<N> as FromField>::Field ) -> Result<Identifier<N>, Error>
Initializes a new identifier from a field element.
type Field = Field<N>
§impl<N> FromStr for Identifier<N>where
N: Network,
impl<N> FromStr for Identifier<N>where
N: Network,
§impl<N> Hash for Identifier<N>where
N: Network,
impl<N> Hash for Identifier<N>where
N: Network,
§impl<N> Parser for Identifier<N>where
N: Network,
impl<N> Parser for Identifier<N>where
N: Network,
§impl<N> PartialEq for Identifier<N>where
N: Network,
impl<N> PartialEq for Identifier<N>where
N: Network,
§impl<N> Serialize for Identifier<N>where
N: Network,
impl<N> Serialize for Identifier<N>where
N: Network,
§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serializes the identifier into string or bytes.
§impl<N> ToBits for &Identifier<N>where
N: Network,
impl<N> ToBits for &Identifier<N>where
N: Network,
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
Returns the little-endian bits of the identifier.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
Returns the big-endian bits of the identifier.
§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
self
as a boolean array in little-endian order.§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
self
as a boolean array in big-endian order.§impl<N> ToBits for Identifier<N>where
N: Network,
impl<N> ToBits for Identifier<N>where
N: Network,
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
Returns the little-endian bits of the identifier.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
Returns the big-endian bits of the identifier.
§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
self
as a boolean array in little-endian order.§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
self
as a boolean array in big-endian order.§impl<N> ToBytes for Identifier<N>where
N: Network,
impl<N> ToBytes for Identifier<N>where
N: Network,
§impl<N> ToField for &Identifier<N>where
N: Network,
impl<N> ToField for &Identifier<N>where
N: Network,
§impl<N> ToField for Identifier<N>where
N: Network,
impl<N> ToField for Identifier<N>where
N: Network,
§impl<N> TryFrom<&String> for Identifier<N>where
N: Network,
impl<N> TryFrom<&String> for Identifier<N>where
N: Network,
§impl<N> TryFrom<&str> for Identifier<N>where
N: Network,
impl<N> TryFrom<&str> for Identifier<N>where
N: Network,
§impl<N> TryFrom<String> for Identifier<N>where
N: Network,
impl<N> TryFrom<String> for Identifier<N>where
N: Network,
impl<N> Copy for Identifier<N>
impl<N> Eq for Identifier<N>where
N: Network,
Auto Trait Implementations§
impl<N> RefUnwindSafe for Identifier<N>where
<N as Environment>::Field: RefUnwindSafe,
impl<N> Send for Identifier<N>
impl<N> Sync for Identifier<N>
impl<N> Unpin for Identifier<N>where
<N as Environment>::Field: Unpin,
impl<N> UnwindSafe for Identifier<N>where
<N as Environment>::Field: 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
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§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
§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
key
and return true
if they are equal.