Trait gluon_vm::api::Pushable

source ·
pub trait Pushable<'vm>: AsyncPushable<'vm> {
    // Required method
    fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>;

    // Provided methods
    fn status_push(self, context: &mut ActiveThread<'vm>) -> Status
       where Self: Sized { ... }
    unsafe fn marshal_unrooted(self, vm: &'vm Thread) -> Result<Value>
       where Self: Sized { ... }
    fn marshal<T>(self, vm: &'vm Thread) -> Result<RootedValue<T>>
       where Self: Sized,
             T: VmRoot<'vm> { ... }
}
Expand description

Trait which allows a rust value to be pushed to the virtual machine

Required Methods§

source

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

Pushes self to stack. If the call is successful a single element should have been added to the stack and Ok(()) should be returned. If the call is unsuccessful Status:Error should be returned and the stack should be left intact

Provided Methods§

source

fn status_push(self, context: &mut ActiveThread<'vm>) -> Status
where Self: Sized,

source

unsafe fn marshal_unrooted(self, vm: &'vm Thread) -> Result<Value>
where Self: Sized,

source

fn marshal<T>(self, vm: &'vm Thread) -> Result<RootedValue<T>>
where Self: Sized, T: VmRoot<'vm>,

Implementations on Foreign Types§

source§

impl<'s, 'vm, T> Pushable<'vm> for Ref<'s, T>
where for<'t> &'t T: Pushable<'vm>, T: VmType,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for Ordering

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for Value

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for bool

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for char

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for f32

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for f64

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for i16

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for i32

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for i64

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for isize

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for u8

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for u16

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for u32

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for u64

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for ()

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for usize

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for String

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for OsString

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm> Pushable<'vm> for PathBuf

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, 's> Pushable<'vm> for &'s str

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, 's> Pushable<'vm> for &'s String

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, 's> Pushable<'vm> for &'s OsStr

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, 's> Pushable<'vm> for &'s OsString

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, 's> Pushable<'vm> for &'s Path

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, 's> Pushable<'vm> for &'s PathBuf

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, 's, T> Pushable<'vm> for &'s [T]
where T: Trace + Pushable<'vm> + 's, &'s [T]: DataDef<Value = ValueArray>,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

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

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

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

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

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

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

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

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

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

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

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

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

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

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, H, I, J, K, L> Pushable<'vm> for (H, I, J, K, L)
where H: Pushable<'vm>, I: Pushable<'vm>, J: Pushable<'vm>, K: Pushable<'vm>, L: Pushable<'vm>,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, I, J, K, L> Pushable<'vm> for (I, J, K, L)
where I: Pushable<'vm>, J: Pushable<'vm>, K: Pushable<'vm>, L: Pushable<'vm>,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, J, K, L> Pushable<'vm> for (J, K, L)
where J: Pushable<'vm>, K: Pushable<'vm>, L: Pushable<'vm>,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, K, L> Pushable<'vm> for (K, L)
where K: Pushable<'vm>, L: Pushable<'vm>,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, K, V> Pushable<'vm> for BTreeMap<K, V>
where K: Borrow<str> + VmType, K::Type: Sized, V: for<'vm2> Pushable<'vm2> + VmType, V::Type: Sized,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, T> Pushable<'vm> for Vec<T>
where T: Pushable<'vm>,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, T: Pushable<'vm>> Pushable<'vm> for Option<T>

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

source§

impl<'vm, T: Pushable<'vm>, E: Pushable<'vm>> Pushable<'vm> for Result<T, E>

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

Implementors§

source§

impl<'__vm> Pushable<'__vm> for gluon_vm::api::json::Value

source§

impl<'__vm> Pushable<'__vm> for JsonString

source§

impl<'__vm, 'a> Pushable<'__vm> for Component<'a>

source§

impl<'s, 'value, 'vm, T, V> Pushable<'vm> for Opaque<T, V>
where T: Pushable<'vm>, V: ?Sized,

source§

impl<'vm> Pushable<'vm> for Variants<'vm>

source§

impl<'vm> Pushable<'vm> for RootedThread

source§

impl<'vm> Pushable<'vm> for CPrimitive

source§

impl<'vm> Pushable<'vm> for JsonValue

source§

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

source§

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

source§

impl<'vm, F> Pushable<'vm> for Primitive<F>
where F: FunctionType + VmType,

source§

impl<'vm, T> Pushable<'vm> for RootedValue<T>
where T: VmRootInternal,

source§

impl<'vm, T> Pushable<'vm> for Ser<T>
where T: Serialize,

source§

impl<'vm, T> Pushable<'vm> for Collect<T>
where T: IntoIterator, T::Item: Pushable<'vm>,

source§

impl<'vm, T> Pushable<'vm> for UserdataValue<T>
where T: Userdata,

source§

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

source§

impl<'vm, T, F> Pushable<'vm> for Function<T, F>
where T: VmRootInternal, F: VmType + Any,

source§

impl<'vm, T, R: ?Sized> Pushable<'vm> for PushAsRef<T, R>
where T: AsRef<R>, for<'a> &'a R: Pushable<'vm>,

source§

impl<'vm, T, U> Pushable<'vm> for Record<T, U>
where U: PushableFieldList<'vm>,

source§

impl<'vm, T: Pushable<'vm>> Pushable<'vm> for IO<T>

source§

impl<'vm, T: Pushable<'vm>, E: Display> Pushable<'vm> for RuntimeResult<T, E>

source§

impl<'vm, T: Userdata> Pushable<'vm> for T

source§

impl<'vm, T: VmType> Pushable<'vm> for TypedBytecode<T>