Primitive std::u8

u8
Expand description
8-bit unsigned integer

Implementations

pub fn is_zero(self) -> bool

Returns whether a u8 is set to zero.

Returns

  • [bool] -> True if the u8 is zero, otherwise false.

Examples

fn foo() {
    let zero_u8 = u8::zero();
    assert(zero_u8.is_zero());
}

Trait Implementations

pub fn sqrt(self) -> Self

pub fn pow(self, exponent: u32) -> Self

pub fn log(self, base: Self) -> Self

pub fn log2(self) -> Self

pub fn try_from(u: u16) -> Option<Self>

pub fn try_from(u: u32) -> Option<Self>

pub fn try_from(u: u64) -> Option<Self>

pub fn try_from(u: u256) -> Option<Self>

pub fn try_from(u: U128) -> Option<Self>

pub fn hash(
self,
refmut state: Hasher,
)