CallStack

Struct CallStack 

Source
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

Source

pub fn new() -> CallStack

Source

pub fn push_i32(&mut self, value: i32)

Source

pub fn push_i64(&mut self, value: i64)

Source

pub fn push_f32(&mut self, value: f32)

Source

pub fn push_f64(&mut self, value: f64)

Source

pub fn push_str(&mut self, value: &str)

Source

pub fn push_bool(&mut self, value: bool)

Source

pub fn push_object(&mut self, value: &dyn IObject)

Source

pub fn push_vec2(&mut self, value: &Vec2)

Source

pub fn push_size(&mut self, value: &Size)

Source

pub fn pop_i32(&mut self) -> Option<i32>

Pops the value from the stack if it is a i32.

Source

pub fn pop_i64(&mut self) -> Option<i64>

Pops the value from the stack if it is a i64.

Source

pub fn pop_f32(&mut self) -> Option<f32>

Pops the value from the stack if it is a f32.

Source

pub fn pop_f64(&mut self) -> Option<f64>

Pops the value from the stack if it is a f64.

Source

pub fn pop_str(&mut self) -> Option<String>

Pops the value from the stack if it is a string.

Source

pub fn pop_bool(&mut self) -> Option<bool>

Pops the value from the stack if it is a bool.

Source

pub fn pop_vec2(&mut self) -> Option<Vec2>

Pops the value from the stack if it is a Vec2 object.

Source

pub fn pop_size(&mut self) -> Option<Size>

Pops the value from the stack if it is a Size object.

Source

pub fn pop_object(&mut self) -> Option<Box<dyn IObject>>

Pops the value from the stack if it is an object.

Source

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()).

Source

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()).

Source

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()).

Source

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()).

Source

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()).

Source

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()).

Source

pub fn pop_cast<T: Clone + 'static>(&mut self) -> Option<T>

Pops a value from the stack and then casts it to the specified type. If the value on the stack is not a object or can not be casted, it returns None. This function is the same as cast::<T>(stack.pop_object()?.as_ref()).

Source

pub fn pop(&mut self) -> bool

Pops a value from the stack. Returns true if a value was popped, otherwise false.

Trait Implementations§

Source§

impl Drop for CallStack

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.