Trait bnum::BTryFrom

source ·
pub trait BTryFrom<T>: Sized {
    type Error;

    // Required method
    fn try_from(from: T) -> Result<Self, Self::Error>;
}
Expand description

Trait for fallible conversions between bnum integer types.

Unfortunately, TryFrom cannot currently be used for conversions between bnum integers, since TryFrom<T> for T is already implemented by the standard library (and so it is not possible to implement TryFrom<BUint<M>> for BUint<N>). When the generic_const_exprs feature becomes stabilised, it may be possible to use TryFrom instead of BTryFrom. BTryFrom is designed to have the same behaviour as TryFrom for conversions between two primitive types, and conversions between a primitive type and a bnum type. BTryFrom is a workaround for the issue described above, and so you should not implement it yourself. It should only be used for conversions between bnum integers.

Required Associated Types§

Required Methods§

source

fn try_from(from: T) -> Result<Self, Self::Error>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BInt<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BIntD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BIntD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BIntD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BUint<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BUintD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BUintD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BUintD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BInt<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BIntD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BIntD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BIntD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BUint<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BUintD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BUintD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BUintD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BInt<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BIntD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BIntD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BIntD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BUint<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BUintD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BUintD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BUintD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BInt<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BIntD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BIntD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BIntD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BUint<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BUintD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BUintD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BUintD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BInt<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BIntD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BIntD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BIntD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BUint<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BUintD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BUintD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BUintD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BInt<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BIntD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BIntD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BIntD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BUint<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BUintD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BUintD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BUintD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BInt<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BIntD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BIntD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BIntD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BUint<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BUintD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BUintD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BUintD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BInt<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BIntD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BIntD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BIntD32<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BUint<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BUintD8<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BUintD16<M>

source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BUintD32<M>