Struct snarkvm_wasm::program::Identifier
pub struct Identifier<N>(_, _)
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>where
N: Clone + Network,
impl<N> Clone for Identifier<N>where
N: Clone + Network,
fn clone(&self) -> Identifier<N>
fn clone(&self) -> Identifier<N>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl<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<Identifier<N>> for Identifier<N>where
N: Network,
impl<N> Equal<Identifier<N>> for Identifier<N>where
N: Network,
fn is_equal(
&self,
other: &Identifier<N>
) -> <Identifier<N> as Equal<Identifier<N>>>::Output
fn is_equal(
&self,
other: &Identifier<N>
) -> <Identifier<N> as Equal<Identifier<N>>>::Output
Returns true
if self
and other
are equal.
fn is_not_equal(
&self,
other: &Identifier<N>
) -> <Identifier<N> as Equal<Identifier<N>>>::Output
fn is_not_equal(
&self,
other: &Identifier<N>
) -> <Identifier<N> as Equal<Identifier<N>>>::Output
Returns true
if self
and other
are not equal.
type Output = Boolean<N>
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,
fn from_str(
identifier: &str
) -> Result<Identifier<N>, <Identifier<N> as FromStr>::Err>
fn from_str(
identifier: &str
) -> Result<Identifier<N>, <Identifier<N> as FromStr>::Err>
Reads in an identifier from a string.
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,
fn parse(string: &str) -> Result<(&str, Identifier<N>), Err<VerboseError<&str>>>
fn parse(string: &str) -> Result<(&str, Identifier<N>), Err<VerboseError<&str>>>
Parses a string into an identifier.
Requirements
The identifier must be alphanumeric (or underscore). The identifier must not start with a number. The identifier must not be a keyword.
impl<N> PartialEq<Identifier<N>> for Identifier<N>where
N: Network,
impl<N> PartialEq<Identifier<N>> 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,
impl<N> ToBits for Identifier<N>where
N: Network,
impl<N> ToBits for Identifier<N>where
N: Network,
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<&str> for Identifier<N>where
N: Network,
impl<N> TryFrom<&str> for Identifier<N>where
N: Network,
impl<N> Copy for Identifier<N>where
N: Copy + Network,
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;