NumExt

Trait NumExt 

Source
pub trait NumExt {
    type PwrType;

    // Required methods
    fn len(&self) -> usize;
    fn head(&self, n: Self::PwrType) -> Self;
    fn mid(&self, start: Self::PwrType, len: Self::PwrType) -> Self;
    fn pop(&self, n: Self::PwrType) -> Self;
    fn tovec(&self, by: Self::PwrType) -> Vec<Self>
       where Self: Sized;
    fn format(&self, sep: &str) -> String;
}

Required Associated Types§

Required Methods§

Source

fn len(&self) -> usize

Source

fn head(&self, n: Self::PwrType) -> Self

Source

fn mid(&self, start: Self::PwrType, len: Self::PwrType) -> Self

Source

fn pop(&self, n: Self::PwrType) -> Self

Source

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source

fn format(&self, sep: &str) -> String

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl NumExt for f32

Source§

fn mid(&self, start: Self::PwrType, len: Self::PwrType) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = f32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for f64

Source§

fn mid(&self, start: Self::PwrType, len: Self::PwrType) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = f64

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for i8

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for i16

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for i32

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for i64

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for i128

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for u8

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for u16

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for u32

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for u64

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Source§

impl NumExt for u128

Source§

fn mid(&self, start: u32, len: u32) -> Self

§panic

panic if (self.len - start) < len

Source§

type PwrType = u32

Source§

fn len(&self) -> usize

Source§

fn head(&self, n: Self::PwrType) -> Self

Source§

fn pop(&self, n: Self::PwrType) -> Self

Source§

fn tovec(&self, by: Self::PwrType) -> Vec<Self>
where Self: Sized,

Source§

fn format(&self, sep: &str) -> String

Implementors§