[][src]Struct kernel::common::math::PowerOfTwo

pub struct PowerOfTwo(u32);

Methods

impl PowerOfTwo[src]

Represents an integral power-of-two as an exponent

pub fn exp<R>(self) -> R where
    R: From<u32>, 
[src]

Returns the base-2 exponent as a numeric type

pub fn floor<F: Into<u32>>(f: F) -> PowerOfTwo[src]

Converts a number two the nearest PowerOfTwo less-than-or-equal to it.

pub fn ceiling<F: Into<u32>>(f: F) -> PowerOfTwo[src]

Converts a number two the nearest PowerOfTwo greater-than-or-equal to it.

pub fn zero() -> PowerOfTwo[src]

Creates a new PowerOfTwo representing the number zero.

pub fn as_num<F: From<u32>>(self) -> F[src]

Converts a PowerOfTwo to a number.

Trait Implementations

impl Debug for PowerOfTwo[src]

impl PartialEq<PowerOfTwo> for PowerOfTwo[src]

impl Eq for PowerOfTwo[src]

impl Ord for PowerOfTwo[src]

impl PartialOrd<PowerOfTwo> for PowerOfTwo[src]

impl Copy for PowerOfTwo[src]

impl Clone for PowerOfTwo[src]

Auto Trait Implementations

impl Unpin for PowerOfTwo

impl Send for PowerOfTwo

impl Sync for PowerOfTwo

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]