[−][src]Trait rosy::vm::EvalArgs
A type that can be used as one or more arguments for evaluating code within
the context of a Mixin
.
The difference between eval_in_object
and eval_in_mixin
See the documentation of its implementors for much more detailed information.
Safety
Code executed from self
may void the type safety of objects accessible
from Rust. For example, if one calls push
on an Array<A>
with an
object of type B
, then the inserted object will be treated as being of
type A
.
For non-protected
variants, if an exception is raised due to an argument
error or from evaluating the script itself, it should be caught.
Required methods
unsafe fn eval_in_object(self, object: impl Into<AnyObject>) -> AnyObject
Evaluates self
in the context of object
.
This corresponds directly to rb_obj_instance_eval
.
In order to set the context, the variable self
is set to object
while the code is executing, giving the code access to object
's
instance variables and private methods.
unsafe fn eval_in_object_protected(
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
Evaluates self
in the context of object
, returning any raised
exceptions.
unsafe fn eval_in_mixin(self, mixin: impl Mixin) -> AnyObject
Evaluates self
in the context of mixin
.
This corresponds directly to rb_mod_module_eval
.
unsafe fn eval_in_mixin_protected(self, mixin: impl Mixin) -> Result<AnyObject>
Evaluates self
in the context of mixin
, returning any raised
exceptions.
Implementations on Foreign Types
impl<O: Object, '_> EvalArgs for &'_ [O]
[src]
Unchecked arguments directly to the evaluation function.
unsafe fn eval_in_object_protected(
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
[src]
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
unsafe fn eval_in_object(self, object: impl Into<AnyObject>) -> AnyObject
[src]
unsafe fn eval_in_mixin_protected(self, mixin: impl Mixin) -> Result<AnyObject>
[src]
unsafe fn eval_in_mixin(self, mixin: impl Mixin) -> AnyObject
[src]
impl<'_> EvalArgs for &'_ str
[src]
The script argument as a UTF-8 string, without any extra information.
unsafe fn eval_in_object_protected(
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
[src]
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
unsafe fn eval_in_object(self, object: impl Into<AnyObject>) -> AnyObject
[src]
unsafe fn eval_in_mixin_protected(self, mixin: impl Mixin) -> Result<AnyObject>
[src]
unsafe fn eval_in_mixin(self, mixin: impl Mixin) -> AnyObject
[src]
impl<S: Into<String>, F: Into<String>> EvalArgs for (S, F)
[src]
The script and filename arguments.
unsafe fn eval_in_object_protected(
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
[src]
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
unsafe fn eval_in_object(self, object: impl Into<AnyObject>) -> AnyObject
[src]
unsafe fn eval_in_mixin_protected(self, mixin: impl Mixin) -> Result<AnyObject>
[src]
unsafe fn eval_in_mixin(self, mixin: impl Mixin) -> AnyObject
[src]
impl<S, F, L> EvalArgs for (S, F, L) where
S: Into<String>,
F: Into<String>,
L: Into<Integer>,
[src]
S: Into<String>,
F: Into<String>,
L: Into<Integer>,
The script, filename, and line number arguments.
unsafe fn eval_in_object_protected(
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
[src]
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
unsafe fn eval_in_object(self, object: impl Into<AnyObject>) -> AnyObject
[src]
unsafe fn eval_in_mixin_protected(self, mixin: impl Mixin) -> Result<AnyObject>
[src]
unsafe fn eval_in_mixin(self, mixin: impl Mixin) -> AnyObject
[src]
Implementors
impl EvalArgs for String
[src]
The script argument without any extra information.
unsafe fn eval_in_object_protected(
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>
[src]
self,
object: impl Into<AnyObject>
) -> Result<AnyObject>