POrSType

Enum POrSType 

Source
pub enum POrSType<PType, SType> {
    P(PType),
    S(SType),
}
Expand description

A type that can be either a PType or an SType, whose View is the same as PType. This is used for the continuation in Pair.

Variants§

§

P(PType)

Represents the (reference of) parsed type

§

S(SType)

Represents the type to be serialized

Implementations§

Source§

impl<PType, SType> POrSType<PType, SType>

Source

pub fn arrow_P_0(self) -> PType

Source

pub fn arrow_S_0(self) -> SType

Trait Implementations§

Source§

impl<'a> Continuation<POrSType<&'a u8, &u8>> for BtVarintCont

Source§

open spec fn requires(&self, t: POrSType<&'a u8, &u8>) -> bool

{ true }
Source§

open spec fn ensures(&self, t: POrSType<&'a u8, &u8>, o: Self::Output) -> bool

{ o@ == (self@)(t@) }
Source§

exec fn apply(&self, t: POrSType<&'a u8, &u8>) -> Self::Output

Source§

type Output = Choice<Cond<Fixed<0>>, Choice<Cond<Refined<U16Le, PredU16LeFit>>, Choice<Cond<Refined<U32Le, PredU32LeFit>>, Cond<Refined<U64Le, PredU64LeFit>>>>>

Output type of the continuation
Source§

impl<PType: View, SType: View<V = <PType as View>::V>> View for POrSType<PType, SType>

Source§

open spec fn view(&self) -> Self::V

{
    match self {
        POrSType::P(p) => p@,
        POrSType::S(s) => s@,
    }
}
Source§

type V = <PType as View>::V

Auto Trait Implementations§

§

impl<PType, SType> Freeze for POrSType<PType, SType>
where PType: Freeze, SType: Freeze,

§

impl<PType, SType> RefUnwindSafe for POrSType<PType, SType>
where PType: RefUnwindSafe, SType: RefUnwindSafe,

§

impl<PType, SType> Send for POrSType<PType, SType>
where PType: Send, SType: Send,

§

impl<PType, SType> Sync for POrSType<PType, SType>
where PType: Sync, SType: Sync,

§

impl<PType, SType> Unpin for POrSType<PType, SType>
where PType: Unpin, SType: Unpin,

§

impl<PType, SType> UnwindSafe for POrSType<PType, SType>
where PType: UnwindSafe, SType: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T
where T: View, <T as View>::V: SpecFrom<<T as View>::V>,

Source§

exec fn ex_from(t: T) -> res : T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: From<T>,

§

fn obeys_from_spec() -> bool

§

fn from_spec(v: T) -> VERUS_SPEC__A

Source§

impl<T, U> Into<U> for T
where T: View, U: View + From<T>, <U as View>::V: SpecFrom<<T as View>::V>,

Source§

exec fn ex_into(self) -> U

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: Into<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> T

§

impl<T, U> IntoSpecImpl<U> for T
where U: From<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> U

Source§

impl<T> SpecFrom<T> for T

Source§

open spec fn spec_from(t: T) -> T

{ t }
Source§

impl<T, U> SpecInto<U> for T
where U: SpecFrom<T>,

Source§

open spec fn spec_into(self) -> U

{ U::spec_from(self) }
Source§

impl<T, U> SpecTryInto<U> for T
where U: SpecTryFrom<T>,

Source§

open spec fn spec_try_into(self) -> Result<U, <U as SpecTryFrom<T>>::Error>

{ U::spec_try_from(self) }
Source§

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

The type returned in the event of a conversion error.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryFrom<T>,

§

fn obeys_try_from_spec() -> bool

§

fn try_from_spec( v: T, ) -> Result<VERUS_SPEC__A, <VERUS_SPEC__A as TryFrom<T>>::Error>

Source§

impl<T, U> TryInto<U> for T
where T: View, U: View + TryFrom<T>, <U as View>::V: SpecTryFrom<<T as View>::V>,

Source§

exec fn ex_try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Source§

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

The type returned in the event of a conversion error.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryInto<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<T, <VERUS_SPEC__A as TryInto<T>>::Error>

§

impl<T, U> TryIntoSpecImpl<U> for T
where U: TryFrom<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<U, <U as TryFrom<T>>::Error>