Skip to main content

IsInteger

Trait IsInteger 

Source
pub trait IsInteger: SealedInteger { }
Available on crate features msg or queue only.
Expand description

Trait to identify integer types for implementations.

This trait is sealed and can only be implemented by prosa_utils for supported integer types.

use prosa_utils::hash::IsInteger;

/// When you implement the trait, P need to be an integer
pub trait IntegerGetter<P: IsInteger> {
    /// Returns an integer
    fn get_int(&self) -> P;
}
struct CustomInteger(u64);

impl prosa_utils::hash::IsInteger for CustomInteger {}

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IsInteger for NonZeroI8

Source§

impl IsInteger for NonZeroI16

Source§

impl IsInteger for NonZeroI32

Source§

impl IsInteger for NonZeroI64

Source§

impl IsInteger for NonZeroIsize

Source§

impl IsInteger for NonZeroU8

Source§

impl IsInteger for NonZeroU16

Source§

impl IsInteger for NonZeroU32

Source§

impl IsInteger for NonZeroU64

Source§

impl IsInteger for NonZeroUsize

Source§

impl IsInteger for i8

Source§

impl IsInteger for i16

Source§

impl IsInteger for i32

Source§

impl IsInteger for i64

Source§

impl IsInteger for isize

Source§

impl IsInteger for u8

Source§

impl IsInteger for u16

Source§

impl IsInteger for u32

Source§

impl IsInteger for u64

Source§

impl IsInteger for usize

Implementors§