Trait gluon_vm::api::Getable

source ·
pub trait Getable<'vm, 'value>: Sized {
    type Proxy: 'value;

    // Required methods
    fn from_value(vm: &'vm Thread, value: Variants<'value>) -> Self;
    fn to_proxy(vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>;
    fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self;
}
Expand description

Trait which allows rust values to be retrieved from the virtual machine

Required Associated Types§

source

type Proxy: 'value

Required Methods§

source

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> Self

source

fn to_proxy(vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'vm, 'value> Getable<'vm, 'value> for &'value str

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_vm: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for &'value Path

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for Ordering

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Ordering

source§

impl<'vm, 'value> Getable<'vm, 'value> for Value

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for bool

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> bool

source§

impl<'vm, 'value> Getable<'vm, 'value> for char

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> char

source§

impl<'vm, 'value> Getable<'vm, 'value> for f32

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for f64

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> f64

source§

impl<'vm, 'value> Getable<'vm, 'value> for i16

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for i32

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for i64

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for isize

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for u8

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> u8

source§

impl<'vm, 'value> Getable<'vm, 'value> for u16

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for u32

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for u64

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for ()

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, _: Variants<'_>)

source§

impl<'vm, 'value> Getable<'vm, 'value> for usize

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for String

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> String

source§

impl<'vm, 'value> Getable<'vm, 'value> for OsString

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value> Getable<'vm, 'value> for PathBuf

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value, A: Getable<'vm, 'value>, B: Getable<'vm, 'value>, C: Getable<'vm, 'value>, D: Getable<'vm, 'value>, E: Getable<'vm, 'value>, F: Getable<'vm, 'value>, G: Getable<'vm, 'value>, H: Getable<'vm, 'value>, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (A, B, C, D, E, F, G, H, I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value( vm: &'vm Thread, value: Variants<'value> ) -> (A, B, C, D, E, F, G, H, I, J, K, L)

source§

impl<'vm, 'value, B: Getable<'vm, 'value>, C: Getable<'vm, 'value>, D: Getable<'vm, 'value>, E: Getable<'vm, 'value>, F: Getable<'vm, 'value>, G: Getable<'vm, 'value>, H: Getable<'vm, 'value>, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (B, C, D, E, F, G, H, I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value( vm: &'vm Thread, value: Variants<'value> ) -> (B, C, D, E, F, G, H, I, J, K, L)

source§

impl<'vm, 'value, C: Getable<'vm, 'value>, D: Getable<'vm, 'value>, E: Getable<'vm, 'value>, F: Getable<'vm, 'value>, G: Getable<'vm, 'value>, H: Getable<'vm, 'value>, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (C, D, E, F, G, H, I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value( vm: &'vm Thread, value: Variants<'value> ) -> (C, D, E, F, G, H, I, J, K, L)

source§

impl<'vm, 'value, D: Getable<'vm, 'value>, E: Getable<'vm, 'value>, F: Getable<'vm, 'value>, G: Getable<'vm, 'value>, H: Getable<'vm, 'value>, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (D, E, F, G, H, I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value( vm: &'vm Thread, value: Variants<'value> ) -> (D, E, F, G, H, I, J, K, L)

source§

impl<'vm, 'value, E: Getable<'vm, 'value>, F: Getable<'vm, 'value>, G: Getable<'vm, 'value>, H: Getable<'vm, 'value>, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (E, F, G, H, I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value( vm: &'vm Thread, value: Variants<'value> ) -> (E, F, G, H, I, J, K, L)

source§

impl<'vm, 'value, F: Getable<'vm, 'value>, G: Getable<'vm, 'value>, H: Getable<'vm, 'value>, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (F, G, H, I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> (F, G, H, I, J, K, L)

source§

impl<'vm, 'value, G: Getable<'vm, 'value>, H: Getable<'vm, 'value>, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (G, H, I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> (G, H, I, J, K, L)

source§

impl<'vm, 'value, H: Getable<'vm, 'value>, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (H, I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> (H, I, J, K, L)

source§

impl<'vm, 'value, I: Getable<'vm, 'value>, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (I, J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> (I, J, K, L)

source§

impl<'vm, 'value, J: Getable<'vm, 'value>, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (J, K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> (J, K, L)

source§

impl<'vm, 'value, K, V> Getable<'vm, 'value> for BTreeMap<K, V>
where K: Getable<'vm, 'value> + Ord, V: Getable<'vm, 'value>,

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value, K: Getable<'vm, 'value>, L: Getable<'vm, 'value>> Getable<'vm, 'value> for (K, L)

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> (K, L)

source§

impl<'vm, 'value, T> Getable<'vm, 'value> for &'value T
where T: Userdata,

§

type Proxy = RefProxy<'value, T>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(_vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_vm: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value, T> Getable<'vm, 'value> for &'value mut T
where T: Userdata,

§

type Proxy = WriteGuard<'value, T>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(_vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_vm: &'vm Thread, _value: Variants<'value>) -> Self

source§

impl<'vm, 'value, T> Getable<'vm, 'value> for Vec<T>
where T: Getable<'vm, 'value>,

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> Vec<T>

source§

impl<'vm, 'value, T: Copy + ArrayRepr> Getable<'vm, 'value> for &'value [T]

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_vm: &'vm Thread, value: Variants<'value>) -> Self

source§

impl<'vm, 'value, T: Getable<'vm, 'value>> Getable<'vm, 'value> for Option<T>

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> Option<T>

source§

impl<'vm, 'value, T: Getable<'vm, 'value>> Getable<'vm, 'value> for Box<T>

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> Box<T>

source§

impl<'vm, 'value, T: Getable<'vm, 'value>, E: Getable<'vm, 'value>> Getable<'vm, 'value> for Result<T, E>

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(vm: &'vm Thread, value: Variants<'value>) -> StdResult<T, E>

source§

impl<'vm, 'value, T: Userdata> Getable<'vm, 'value> for *const T

§

type Proxy = Variants<'value>

source§

fn to_proxy(_vm: &'vm Thread, value: Variants<'value>) -> Result<Self::Proxy>

source§

fn from_proxy(vm: &'vm Thread, proxy: &'value mut Self::Proxy) -> Self

source§

fn from_value(_: &'vm Thread, value: Variants<'value>) -> *const T

Implementors§

source§

impl<'__value, '__vm> Getable<'__vm, '__value> for gluon_vm::api::json::Value

§

type Proxy = Variants<'__value>

source§

impl<'__value, '__vm> Getable<'__vm, '__value> for JsonString

§

type Proxy = Variants<'__value>

source§

impl<'vm, 'value> Getable<'vm, 'value> for ValueRef<'value>

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value> Getable<'vm, 'value> for RootedThread

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value> Getable<'vm, 'value> for JsonValue

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, F> Getable<'vm, 'value> for Function<&'vm Thread, F>

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, F> Getable<'vm, 'value> for Function<RootedThread, F>

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, T> Getable<'vm, 'value> for RootedValue<T>
where T: Deref<Target = Thread> + VmRoot<'vm>,

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, T> Getable<'vm, 'value> for De<T>

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, T> Getable<'vm, 'value> for Collect<GetableIter<'vm, 'value, T>>
where T: Getable<'vm, 'value>,

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, T> Getable<'vm, 'value> for UserdataValue<T>
where T: Userdata + Clone,

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, T> Getable<'vm, 'value> for WithVM<'vm, T>
where T: Getable<'vm, 'value>,

§

type Proxy = <T as Getable<'vm, 'value>>::Proxy

source§

impl<'vm, 'value, T, U> Getable<'vm, 'value> for Record<T, U>
where T: Default, U: GetableFieldList<'vm, 'value>,

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, T, V> Getable<'vm, 'value> for OpaqueValue<T, V>
where V: ?Sized, T: VmRoot<'vm>,

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, T: Getable<'vm, 'value>> Getable<'vm, 'value> for IO<T>

§

type Proxy = Variants<'value>

source§

impl<'vm, 'value, V> Getable<'vm, 'value> for Opaque<Variants<'value>, V>
where V: ?Sized,

§

type Proxy = Variants<'value>