pub struct NoteSelector(pub u8);Expand description
A 7-bit note selector identifying a note type within a contract.
Valid values are 0..127 (fits in 7 bits). Assigned at compile time,
not derived from a hash like FunctionSelector.
Tuple Fields§
§0: u8Implementations§
Source§impl NoteSelector
impl NoteSelector
Sourcepub fn new(value: u8) -> Result<NoteSelector, Error>
pub fn new(value: u8) -> Result<NoteSelector, Error>
Create a new NoteSelector, returning an error if value >= 128.
Sourcepub fn empty() -> NoteSelector
pub fn empty() -> NoteSelector
The empty/zero note selector.
Sourcepub fn from_field(field: Fr) -> Result<NoteSelector, Error>
pub fn from_field(field: Fr) -> Result<NoteSelector, Error>
Convert from a field element.
Trait Implementations§
Source§impl Clone for NoteSelector
impl Clone for NoteSelector
Source§fn clone(&self) -> NoteSelector
fn clone(&self) -> NoteSelector
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 NoteSelector
impl Debug for NoteSelector
Source§impl<'de> Deserialize<'de> for NoteSelector
impl<'de> Deserialize<'de> for NoteSelector
Source§fn deserialize<D>(
deserializer: D,
) -> Result<NoteSelector, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NoteSelector, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for NoteSelector
impl Display for NoteSelector
Source§impl Hash for NoteSelector
impl Hash for NoteSelector
Source§impl PartialEq for NoteSelector
impl PartialEq for NoteSelector
Source§impl Serialize for NoteSelector
impl Serialize for NoteSelector
Source§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,
Serialize this value into the given Serde serializer. Read more
impl Copy for NoteSelector
impl Eq for NoteSelector
impl StructuralPartialEq for NoteSelector
Auto Trait Implementations§
impl Freeze for NoteSelector
impl RefUnwindSafe for NoteSelector
impl Send for NoteSelector
impl Sync for NoteSelector
impl Unpin for NoteSelector
impl UnwindSafe for NoteSelector
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> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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
Checks if this value is equivalent to the given key. Read more
§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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.