SpecFrom

Trait SpecFrom 

Source
pub trait SpecFrom<T>: Sized {
    // Required method
    spec fn spec_from(t: T) -> Self;
}
Expand description

Spec version of From.

Required Methods§

Source

spec fn spec_from(t: T) -> Self

Spec version of From::ex_from

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 SpecFrom<VarInt> for usize

Source§

open spec fn spec_from(t: VarInt) -> usize

{
    match t {
        VarInt::U8(t) => t as usize,
        VarInt::U16(t) => t as usize,
        VarInt::U32(t) => t as usize,
        VarInt::U64(t) => t as usize,
    }
}
Source§

impl SpecFrom<u8> for usize

Source§

open spec fn spec_from(t: u8) -> usize

{ t as usize }
Source§

impl SpecFrom<u16> for usize

Source§

open spec fn spec_from(t: u16) -> usize

{ t as usize }
Source§

impl SpecFrom<u32> for usize

Source§

open spec fn spec_from(t: u32) -> usize

{ t as usize }
Source§

impl SpecFrom<u64> for usize

Source§

open spec fn spec_from(t: u64) -> usize

{ t as usize }
Source§

impl SpecFrom<u24> for usize

Source§

open spec fn spec_from(t: u24) -> usize

{ t.spec_as_u32() as usize }

Implementors§

Source§

impl<T> SpecFrom<T> for T