pub struct CallStack { /* private fields */ }Expand description
An argument stack for passing values to a function. The stack is used to pass arguments to a function and to receive return values from a function.
Implementations§
Source§impl CallStack
impl CallStack
pub fn new() -> CallStack
pub fn push_i32(&mut self, value: i32)
pub fn push_i64(&mut self, value: i64)
pub fn push_f32(&mut self, value: f32)
pub fn push_f64(&mut self, value: f64)
pub fn push_str(&mut self, value: &str)
pub fn push_bool(&mut self, value: bool)
pub fn push_object(&mut self, value: &dyn IObject)
pub fn push_vec2(&mut self, value: &Vec2)
pub fn push_size(&mut self, value: &Size)
Sourcepub fn pop_vec2(&mut self) -> Option<Vec2>
pub fn pop_vec2(&mut self) -> Option<Vec2>
Pops the value from the stack if it is a Vec2 object.
Sourcepub fn pop_size(&mut self) -> Option<Size>
pub fn pop_size(&mut self) -> Option<Size>
Pops the value from the stack if it is a Size object.
Sourcepub fn pop_object(&mut self) -> Option<Box<dyn IObject>>
pub fn pop_object(&mut self) -> Option<Box<dyn IObject>>
Pops the value from the stack if it is an object.
Sourcepub fn pop_into_node(&mut self) -> Option<Node>
pub fn pop_into_node(&mut self) -> Option<Node>
Pops the value from the stack and then converts it to a Node. If the value on the stack is not a object or the object can not be converted to a Node, this function returns None.
This function is the same as Node::cast(stack.pop_object()?.as_ref()).
Sourcepub fn pop_into_camera(&mut self) -> Option<Camera>
pub fn pop_into_camera(&mut self) -> Option<Camera>
Pops the value from the stack and then converts it to a Camera. If the value on the stack is not a object or the object can not be converted to a Camera, this function returns None.
This function is the same as Camera::cast(stack.pop_object()?.as_ref()).
Sourcepub fn pop_into_playable(&mut self) -> Option<Playable>
pub fn pop_into_playable(&mut self) -> Option<Playable>
Pops the value from the stack and then converts it to a Playable. If the value on the stack is not a object or the object can not be converted to a Playable, this function returns None.
This function is the same as Playable::cast(stack.pop_object()?.as_ref()).
Sourcepub fn pop_into_physics_world(&mut self) -> Option<PhysicsWorld>
pub fn pop_into_physics_world(&mut self) -> Option<PhysicsWorld>
Pops the value from the stack and then converts it to a PhysicsWorld. If the value on the stack is not a object or the object can not be converted to a PhysicsWorld, this function returns None.
This function is the same as PhysicsWorld::cast(stack.pop_object()?.as_ref()).
Sourcepub fn pop_into_body(&mut self) -> Option<Body>
pub fn pop_into_body(&mut self) -> Option<Body>
Pops the value from the stack and then converts it to a Body. If the value on the stack is not a object or the object can not be converted to a Body, this function returns None.
This function is the same as Body::cast(stack.pop_object()?.as_ref()).
Sourcepub fn pop_into_joint(&mut self) -> Option<Joint>
pub fn pop_into_joint(&mut self) -> Option<Joint>
Pops the value from the stack and then converts it to a Joint. If the value on the stack is not a object or the object can not be converted to a Joint, this function returns None.
This function is the same as Joint::cast(stack.pop_object()?.as_ref()).