pub type EligibilityValue = NonZeroU32;
Expand description

The type of eligibility to use

Aliased Type§

struct EligibilityValue(/* private fields */);

Implementations

§

impl NonZeroU32

pub const fn new(n: u32) -> Option<NonZeroU32>

Creates a new Some(NonZeroU32) instance if value is 0, None otherwise.

pub const fn new_unchecked(n: u32) -> NonZeroU32

new_unchecked creats a NonZeroU32 where the user MUST guarantee that the value is nonzero.

pub fn get(&self) -> u32

Returns the the underlying number

§

impl NonZeroU32

pub fn default() -> NonZeroU32

Default total number of eligible authors, must NOT be 0.

Trait Implementations

§

impl<'de> Deserialize<'de> for NonZeroU32

§

fn deserialize<D>( deserializer: D ) -> Result<NonZeroU32, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Hash for NonZeroU32

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for NonZeroU32

§

fn cmp(&self, other: &NonZeroU32) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl TypeInfo for NonZeroU32

§

type Identity = NonZeroU32

The type identifying for which type info is provided. Read more
§

fn type_info() -> Type

Returns the static type identifier for Self.
§

impl StructuralPartialEq for NonZeroU32

§

impl Debug for NonZeroU32

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialOrd for NonZeroU32

§

fn partial_cmp(&self, other: &NonZeroU32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Encode for NonZeroU32

§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
where __CodecOutputEdqy: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>( &self, f: __CodecUsingEncodedCallback ) -> __CodecOutputReturn
where __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
§

impl Decode for NonZeroU32

§

fn decode<I>(input: &mut I) -> Result<NonZeroU32, Error>
where I: Input,

Attempt to deserialise the value from input.
§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
§

impl Default for NonZeroU32

§

fn default() -> NonZeroU32

Returns the “default value” for a type. Read more
§

impl PartialEq for NonZeroU32

§

fn eq(&self, other: &NonZeroU32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for NonZeroU32

§

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 Eq for NonZeroU32

§

impl EncodeLike for NonZeroU32

§

impl EncodeLike<u32> for NonZeroU32

§

impl Clone for NonZeroU32

§

fn clone(&self) -> NonZeroU32

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Deref for NonZeroU32

§

type Target = u32

The resulting type after dereferencing.
§

fn deref(&self) -> &<NonZeroU32 as Deref>::Target

Dereferences the value.