Struct concordium_std::NonZeroThresholdU8
source · pub struct NonZeroThresholdU8<Kind> { /* private fields */ }
Expand description
A type representing a u8
threshold, typically used for signatures.
Serialization for this type ensures that the threshold is never 0.
This type has a phantom type marker so that thresholds of different types
can be distinguished. The intended use is that a new empty type is defined
to serve as marker, and then a type alias. See AccountThreshold
for an
example.
Implementations§
source§impl<Kind> NonZeroThresholdU8<Kind>
impl<Kind> NonZeroThresholdU8<Kind>
sourcepub const ONE: NonZeroThresholdU8<Kind> = _
pub const ONE: NonZeroThresholdU8<Kind> = _
Threshold of 1.
sourcepub const TWO: NonZeroThresholdU8<Kind> = _
pub const TWO: NonZeroThresholdU8<Kind> = _
Threshold of 2.
Trait Implementations§
source§impl<Kind> Clone for NonZeroThresholdU8<Kind>
impl<Kind> Clone for NonZeroThresholdU8<Kind>
source§fn clone(&self) -> NonZeroThresholdU8<Kind>
fn clone(&self) -> NonZeroThresholdU8<Kind>
Returns a copy 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<Kind> Debug for NonZeroThresholdU8<Kind>where
Kind: Debug,
impl<Kind> Debug for NonZeroThresholdU8<Kind>where
Kind: Debug,
source§impl<Kind> Deserial for NonZeroThresholdU8<Kind>
impl<Kind> Deserial for NonZeroThresholdU8<Kind>
source§fn deserial<R>(source: &mut R) -> Result<NonZeroThresholdU8<Kind>, ParseError>where
R: Read,
fn deserial<R>(source: &mut R) -> Result<NonZeroThresholdU8<Kind>, ParseError>where
R: Read,
Attempt to read a structure from a given source, failing if an error
occurs during deserialization or reading.
source§impl<Kind> From<NonZeroThresholdU8<Kind>> for u8
impl<Kind> From<NonZeroThresholdU8<Kind>> for u8
source§fn from(value: NonZeroThresholdU8<Kind>) -> u8
fn from(value: NonZeroThresholdU8<Kind>) -> u8
Converts to this type from the input type.
source§impl<Kind> Hash for NonZeroThresholdU8<Kind>
impl<Kind> Hash for NonZeroThresholdU8<Kind>
source§impl<Kind> Ord for NonZeroThresholdU8<Kind>
impl<Kind> Ord for NonZeroThresholdU8<Kind>
source§fn cmp(&self, other: &NonZeroThresholdU8<Kind>) -> Ordering
fn cmp(&self, other: &NonZeroThresholdU8<Kind>) -> 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<Kind> PartialEq<u8> for NonZeroThresholdU8<Kind>
impl<Kind> PartialEq<u8> for NonZeroThresholdU8<Kind>
source§impl<Kind> PartialEq for NonZeroThresholdU8<Kind>
impl<Kind> PartialEq for NonZeroThresholdU8<Kind>
source§fn eq(&self, other: &NonZeroThresholdU8<Kind>) -> bool
fn eq(&self, other: &NonZeroThresholdU8<Kind>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Kind> PartialOrd<u8> for NonZeroThresholdU8<Kind>
impl<Kind> PartialOrd<u8> for NonZeroThresholdU8<Kind>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<Kind> PartialOrd for NonZeroThresholdU8<Kind>
impl<Kind> PartialOrd for NonZeroThresholdU8<Kind>
source§fn partial_cmp(&self, other: &NonZeroThresholdU8<Kind>) -> Option<Ordering>
fn partial_cmp(&self, other: &NonZeroThresholdU8<Kind>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<Kind> SchemaType for NonZeroThresholdU8<Kind>
impl<Kind> SchemaType for NonZeroThresholdU8<Kind>
source§impl<Kind> Serial for NonZeroThresholdU8<Kind>
impl<Kind> Serial for NonZeroThresholdU8<Kind>
source§impl<Kind> TryFrom<u8> for NonZeroThresholdU8<Kind>
impl<Kind> TryFrom<u8> for NonZeroThresholdU8<Kind>
§type Error = ZeroSignatureThreshold
type Error = ZeroSignatureThreshold
The type returned in the event of a conversion error.
source§fn try_from(
value: u8
) -> Result<NonZeroThresholdU8<Kind>, <NonZeroThresholdU8<Kind> as TryFrom<u8>>::Error>
fn try_from( value: u8 ) -> Result<NonZeroThresholdU8<Kind>, <NonZeroThresholdU8<Kind> as TryFrom<u8>>::Error>
Performs the conversion.
impl<Kind> Copy for NonZeroThresholdU8<Kind>
impl<Kind> Eq for NonZeroThresholdU8<Kind>
Auto Trait Implementations§
impl<Kind> RefUnwindSafe for NonZeroThresholdU8<Kind>where
Kind: RefUnwindSafe,
impl<Kind> Send for NonZeroThresholdU8<Kind>where
Kind: Send,
impl<Kind> Sync for NonZeroThresholdU8<Kind>where
Kind: Sync,
impl<Kind> Unpin for NonZeroThresholdU8<Kind>where
Kind: Unpin,
impl<Kind> UnwindSafe for NonZeroThresholdU8<Kind>where
Kind: 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<D, S> DeserialWithState<S> for Dwhere
D: Deserial,
S: HasStateApi,
impl<D, S> DeserialWithState<S> for Dwhere
D: Deserial,
S: HasStateApi,
source§fn deserial_with_state<R>(_state: &S, source: &mut R) -> Result<D, ParseError>where
R: Read,
fn deserial_with_state<R>(_state: &S, source: &mut R) -> Result<D, ParseError>where
R: Read,
Attempt to read a structure from a given source and state, failing if
an error occurs during deserialization or reading.