Trait gluon_vm::api::VmType

source ·
pub trait VmType {
    type Type: ?Sized + Any;

    const EXTRA_ARGS: VmIndex = 0u32;

    // Provided methods
    fn make_forall_type(vm: &Thread) -> ArcType { ... }
    fn make_type(vm: &Thread) -> ArcType { ... }
}
Expand description

Trait which maps a type in rust to a type in gluon

Required Associated Types§

source

type Type: ?Sized + Any

A version of Self which implements Any allowing a TypeId to be retrieved

Provided Associated Constants§

source

const EXTRA_ARGS: VmIndex = 0u32

How many extra arguments a function returning this type requires. Used for abstract types which when used in return position should act like they still need more arguments before they are called

Provided Methods§

source

fn make_forall_type(vm: &Thread) -> ArcType

source

fn make_type(vm: &Thread) -> ArcType

Creates an gluon type which maps to Self in rust

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl VmType for Ordering

source§

impl VmType for Value

source§

impl VmType for bool

source§

impl VmType for char

§

type Type = char

source§

impl VmType for f32

§

type Type = f32

source§

impl VmType for f64

§

type Type = f64

source§

impl VmType for i16

§

type Type = i64

source§

impl VmType for i32

§

type Type = i64

source§

impl VmType for i64

§

type Type = i64

source§

impl VmType for isize

§

type Type = i64

source§

impl VmType for str

§

type Type = <String as VmType>::Type

source§

impl VmType for u8

§

type Type = u8

source§

impl VmType for u16

§

type Type = i64

source§

impl VmType for u32

§

type Type = i64

source§

impl VmType for u64

§

type Type = i64

source§

impl VmType for ()

§

type Type = ()

source§

impl VmType for usize

§

type Type = i64

source§

impl VmType for String

§

type Type = String

source§

impl VmType for OsStr

§

type Type = <OsString as VmType>::Type

source§

impl VmType for OsString

§

type Type = String

source§

impl VmType for Path

§

type Type = <PathBuf as VmType>::Type

source§

impl VmType for PathBuf

§

type Type = String

source§

impl<'a> VmType for Component<'a>

§

type Type = Component<'static>

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, A: VmType, B: VmType, C: VmType, D: VmType, E: VmType, F: VmType, G: VmType, R> VmType for dyn Fn(A, B, C, D, E, F, G) -> R + 's
where R: VmType, <R as VmType>::Type: Sized, R::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type, _: <D as VmType>::Type, _: <E as VmType>::Type, _: <F as VmType>::Type, _: <G as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, A: VmType, B: VmType, C: VmType, D: VmType, E: VmType, F: VmType, R> VmType for dyn Fn(A, B, C, D, E, F) -> R + 's
where R: VmType, <R as VmType>::Type: Sized, R::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type, _: <D as VmType>::Type, _: <E as VmType>::Type, _: <F as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, A: VmType, B: VmType, C: VmType, D: VmType, E: VmType, R> VmType for dyn Fn(A, B, C, D, E) -> R + 's
where R: VmType, <R as VmType>::Type: Sized, R::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type, _: <D as VmType>::Type, _: <E as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, A: VmType, B: VmType, C: VmType, D: VmType, R> VmType for dyn Fn(A, B, C, D) -> R + 's
where R: VmType, <R as VmType>::Type: Sized, R::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type, _: <D as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, A: VmType, B: VmType, C: VmType, R> VmType for dyn Fn(A, B, C) -> R + 's
where R: VmType, <R as VmType>::Type: Sized, R::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, A: VmType, B: VmType, R> VmType for dyn Fn(A, B) -> R + 's
where R: VmType, <R as VmType>::Type: Sized, R::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, A: VmType, R> VmType for dyn Fn(A) -> R + 's
where R: VmType, <R as VmType>::Type: Sized, R::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, R: VmType> VmType for dyn Fn() -> IO<R> + 's
where IO<R>: VmType, <IO<R> as VmType>::Type: Sized, R::Type: Sized,

§

type Type = fn() -> <IO<R> as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, T: VmType> VmType for *const T

§

type Type = <T as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, T: VmType> VmType for Box<T>

§

type Type = <T as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'s, T: VmType> VmType for Ref<'s, T>

§

type Type = <T as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'vm, T: ?Sized + VmType> VmType for &'vm T

§

type Type = <T as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'vm, T: ?Sized + VmType> VmType for &'vm mut T

§

type Type = <T as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<'vm, T: ?Sized + VmType> VmType for PhantomData<T>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> VmType for (A, B, C, D, E, F, G, H, I, J, K, L)
where A: VmType, B: VmType, C: VmType, D: VmType, E: VmType, F: VmType, G: VmType, H: VmType, I: VmType, J: VmType, K: VmType, L: VmType, A::Type: Sized, B::Type: Sized, C::Type: Sized, D::Type: Sized, E::Type: Sized, F::Type: Sized, G::Type: Sized, H::Type: Sized, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<A as VmType>::Type, <B as VmType>::Type, <C as VmType>::Type, <D as VmType>::Type, <E as VmType>::Type, <F as VmType>::Type, <G as VmType>::Type, <H as VmType>::Type, <I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<A: VmType, B: VmType, C: VmType, D: VmType, E: VmType, F: VmType, G: VmType, R: VmType> VmType for fn(_: A, _: B, _: C, _: D, _: E, _: F, _: G) -> R
where <R as VmType>::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type, _: <D as VmType>::Type, _: <E as VmType>::Type, _: <F as VmType>::Type, _: <G as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<A: VmType, B: VmType, C: VmType, D: VmType, E: VmType, F: VmType, R: VmType> VmType for fn(_: A, _: B, _: C, _: D, _: E, _: F) -> R
where <R as VmType>::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type, _: <D as VmType>::Type, _: <E as VmType>::Type, _: <F as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<A: VmType, B: VmType, C: VmType, D: VmType, E: VmType, R: VmType> VmType for fn(_: A, _: B, _: C, _: D, _: E) -> R
where <R as VmType>::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type, _: <D as VmType>::Type, _: <E as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<A: VmType, B: VmType, C: VmType, D: VmType, R: VmType> VmType for fn(_: A, _: B, _: C, _: D) -> R
where <R as VmType>::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type, _: <D as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<A: VmType, B: VmType, C: VmType, R: VmType> VmType for fn(_: A, _: B, _: C) -> R
where <R as VmType>::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type, _: <C as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<A: VmType, B: VmType, R: VmType> VmType for fn(_: A, _: B) -> R
where <R as VmType>::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type, _: <B as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<A: VmType, R: VmType> VmType for fn(_: A) -> R
where <R as VmType>::Type: Sized,

§

type Type = fn(_: <A as VmType>::Type) -> <R as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<B, C, D, E, F, G, H, I, J, K, L> VmType for (B, C, D, E, F, G, H, I, J, K, L)
where B: VmType, C: VmType, D: VmType, E: VmType, F: VmType, G: VmType, H: VmType, I: VmType, J: VmType, K: VmType, L: VmType, B::Type: Sized, C::Type: Sized, D::Type: Sized, E::Type: Sized, F::Type: Sized, G::Type: Sized, H::Type: Sized, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<B as VmType>::Type, <C as VmType>::Type, <D as VmType>::Type, <E as VmType>::Type, <F as VmType>::Type, <G as VmType>::Type, <H as VmType>::Type, <I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<C, D, E, F, G, H, I, J, K, L> VmType for (C, D, E, F, G, H, I, J, K, L)
where C: VmType, D: VmType, E: VmType, F: VmType, G: VmType, H: VmType, I: VmType, J: VmType, K: VmType, L: VmType, C::Type: Sized, D::Type: Sized, E::Type: Sized, F::Type: Sized, G::Type: Sized, H::Type: Sized, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<C as VmType>::Type, <D as VmType>::Type, <E as VmType>::Type, <F as VmType>::Type, <G as VmType>::Type, <H as VmType>::Type, <I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<D, E, F, G, H, I, J, K, L> VmType for (D, E, F, G, H, I, J, K, L)
where D: VmType, E: VmType, F: VmType, G: VmType, H: VmType, I: VmType, J: VmType, K: VmType, L: VmType, D::Type: Sized, E::Type: Sized, F::Type: Sized, G::Type: Sized, H::Type: Sized, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<D as VmType>::Type, <E as VmType>::Type, <F as VmType>::Type, <G as VmType>::Type, <H as VmType>::Type, <I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<E, F, G, H, I, J, K, L> VmType for (E, F, G, H, I, J, K, L)
where E: VmType, F: VmType, G: VmType, H: VmType, I: VmType, J: VmType, K: VmType, L: VmType, E::Type: Sized, F::Type: Sized, G::Type: Sized, H::Type: Sized, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<E as VmType>::Type, <F as VmType>::Type, <G as VmType>::Type, <H as VmType>::Type, <I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<F, G, H, I, J, K, L> VmType for (F, G, H, I, J, K, L)
where F: VmType, G: VmType, H: VmType, I: VmType, J: VmType, K: VmType, L: VmType, F::Type: Sized, G::Type: Sized, H::Type: Sized, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<F as VmType>::Type, <G as VmType>::Type, <H as VmType>::Type, <I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<G, H, I, J, K, L> VmType for (G, H, I, J, K, L)
where G: VmType, H: VmType, I: VmType, J: VmType, K: VmType, L: VmType, G::Type: Sized, H::Type: Sized, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<G as VmType>::Type, <H as VmType>::Type, <I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<H, I, J, K, L> VmType for (H, I, J, K, L)
where H: VmType, I: VmType, J: VmType, K: VmType, L: VmType, H::Type: Sized, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<H as VmType>::Type, <I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<I, J, K, L> VmType for (I, J, K, L)
where I: VmType, J: VmType, K: VmType, L: VmType, I::Type: Sized, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<I as VmType>::Type, <J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<J, K, L> VmType for (J, K, L)
where J: VmType, K: VmType, L: VmType, J::Type: Sized, K::Type: Sized, L::Type: Sized,

§

type Type = (<J as VmType>::Type, <K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<K, L> VmType for (K, L)
where K: VmType, L: VmType, K::Type: Sized, L::Type: Sized,

§

type Type = (<K as VmType>::Type, <L as VmType>::Type)

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<K, V> VmType for BTreeMap<K, V>
where K: VmType, K::Type: Sized, V: VmType, V::Type: Sized,

§

type Type = BTreeMap<<K as VmType>::Type, <V as VmType>::Type>

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<R: VmType> VmType for fn() -> IO<R>
where <IO<R> as VmType>::Type: Sized, <R as VmType>::Type: Sized,

§

type Type = fn() -> <IO<R> as VmType>::Type

source§

fn make_type(vm: &Thread) -> ArcType

source§

impl<T> VmType for [T]
where T: VmType, T::Type: Sized,

§

type Type = Vec<<T as VmType>::Type>

source§

fn make_type(thread: &Thread) -> ArcType

source§

impl<T> VmType for Vec<T>
where T: VmType, T::Type: Sized,

§

type Type = Vec<<T as VmType>::Type>

source§

fn make_type(thread: &Thread) -> ArcType

source§

impl<T: VmType> VmType for Option<T>
where T::Type: Sized,

source§

impl<T: VmType, E: VmType> VmType for Result<T, E>
where T::Type: Sized, E::Type: Sized,

§

type Type = Result<<T as VmType>::Type, <E as VmType>::Type>

source§

fn make_type(vm: &Thread) -> ArcType

Implementors§

source§

impl VmType for A

§

type Type = A

source§

impl VmType for B

§

type Type = B

source§

impl VmType for C

§

type Type = C

source§

impl VmType for D

§

type Type = D

source§

impl VmType for E

§

type Type = E

source§

impl VmType for F

§

type Type = F

source§

impl VmType for G

§

type Type = G

source§

impl VmType for H

§

type Type = H

source§

impl VmType for I

§

type Type = I

source§

impl VmType for J

§

type Type = J

source§

impl VmType for K

§

type Type = K

source§

impl VmType for L

§

type Type = L

source§

impl VmType for M

§

type Type = M

source§

impl VmType for N

§

type Type = N

source§

impl VmType for O

§

type Type = O

source§

impl VmType for P

§

type Type = P

source§

impl VmType for Q

§

type Type = Q

source§

impl VmType for R

§

type Type = R

source§

impl VmType for S

§

type Type = S

source§

impl VmType for T

§

type Type = T

source§

impl VmType for U

§

type Type = U

source§

impl VmType for V

§

type Type = V

source§

impl VmType for X

§

type Type = X

source§

impl VmType for Y

§

type Type = Y

source§

impl VmType for Z

§

type Type = Z

source§

impl VmType for gluon_vm::api::json::Value

§

type Type = Value

source§

impl VmType for DirEntry

source§

impl VmType for Metadata

source§

impl VmType for RootedThread

§

type Type = Thread

source§

impl VmType for Thread

§

type Type = Thread

source§

impl VmType for JsonString

§

type Type = String

source§

impl VmType for JsonValue

source§

impl VmType for EmptyRow

source§

impl VmType for Hole

§

type Type = Hole

source§

impl<'a> VmType for gluon_vm::primitives::Component<'a>

§

type Type = Component<'static>

source§

impl<'a, 'b, T> VmType for &'b mut gluon_vm::api::scoped::Ref<'a, T>
where T: Userdata + VmType,

§

type Type = <T as VmType>::Type

source§

impl<'a, 'b, T> VmType for &'b mut RefMut<'a, T>
where T: Userdata + VmType,

§

type Type = <T as VmType>::Type

source§

impl<'vm, F: VmType> VmType for Primitive<F>

§

type Type = <F as VmType>::Type

source§

impl<'vm, T> VmType for WithVM<'vm, T>
where T: VmType,

§

type Type = <T as VmType>::Type

source§

const EXTRA_ARGS: VmIndex = T::EXTRA_ARGS

source§

impl<F> VmType for FutureResult<F>
where F: Future, F::Output: VmType,

§

type Type = <<F as Future>::Output as VmType>::Type

source§

const EXTRA_ARGS: VmIndex = <F::Output>::EXTRA_ARGS

source§

impl<K: VmType, V: VmType> VmType for Map<K, V>
where K::Type: Sized, V::Type: Sized,

§

type Type = Map<<K as VmType>::Type, <V as VmType>::Type>

source§

impl<R, T> VmType for Eff<R, T>
where R: VmType, R::Type: Sized, T: VmType, T::Type: Sized,

§

type Type = Eff<<R as VmType>::Type, <T as VmType>::Type>

source§

impl<T> VmType for IO<T>
where T: VmType, T::Type: Sized,

§

type Type = IO<<T as VmType>::Type>

source§

const EXTRA_ARGS: VmIndex = 1u32

source§

impl<T> VmType for Lazy<T>
where T: VmType, T::Type: Sized,

§

type Type = Lazy<<T as VmType>::Type>

source§

impl<T> VmType for Reference<T>
where T: VmType, T::Type: Sized,

§

type Type = Reference<<T as VmType>::Type>

source§

impl<T> VmType for De<T>
where T: VmType,

§

type Type = <T as VmType>::Type

source§

impl<T> VmType for Ser<T>
where T: VmType,

§

type Type = <T as VmType>::Type

source§

impl<T> VmType for Collect<T>
where T: IntoIterator, T::Item: VmType, <T::Item as VmType>::Type: Sized,

§

type Type = Vec<<<T as IntoIterator>::Item as VmType>::Type>

source§

impl<T> VmType for UserdataValue<T>
where T: ?Sized + VmType,

§

type Type = <T as VmType>::Type

source§

const EXTRA_ARGS: VmIndex = T::EXTRA_ARGS

source§

impl<T, F> VmType for Function<T, F>
where T: VmRootInternal, F: VmType,

§

type Type = <F as VmType>::Type

source§

impl<T, R> VmType for PushAsRef<T, R>
where T: AsRef<R>, R: 'static + ?Sized, &'static R: VmType,

source§

impl<T, V> VmType for Opaque<T, V>
where V: ?Sized + VmType, V::Type: Sized,

§

type Type = <V as VmType>::Type

source§

const EXTRA_ARGS: VmIndex = V::EXTRA_ARGS

source§

impl<T: FieldTypes, U: FieldValues> VmType for Record<T, U>

§

type Type = Record<<T as FieldTypes>::Type, <U as FieldValues>::Type>

source§

impl<T: FieldTypes, U: FieldValues, R: VmType> VmType for Row<T, U, R>

§

type Type = Record<<T as FieldTypes>::Type, <U as FieldValues>::Type>

source§

impl<T: VmType> VmType for Receiver<T>
where T::Type: Sized,

§

type Type = Receiver<<T as VmType>::Type>

source§

impl<T: VmType> VmType for Sender<T>
where T::Type: Sized,

§

type Type = Sender<<T as VmType>::Type>

source§

impl<T: VmType> VmType for TypedBytecode<T>

§

type Type = <T as VmType>::Type

source§

const EXTRA_ARGS: VmIndex = T::EXTRA_ARGS

source§

impl<T: VmType, E> VmType for RuntimeResult<T, E>

§

type Type = <T as VmType>::Type

source§

const EXTRA_ARGS: VmIndex = T::EXTRA_ARGS