pub struct CallStack { /* private fields */ }Expand description
Encapsulates a script call stack.
Implementations§
Source§impl CallStack
impl CallStack
Sourcepub fn pop(&mut self) -> Option<CallFrame>
pub fn pop(&mut self) -> Option<CallFrame>
Removes the top from from the stack. If the stack is empty, does nothing and
returns None; otherwise, returns the removed call frame.
Sourcepub fn push(&mut self, call_type: CallType, source: impl Into<String>)
pub fn push(&mut self, call_type: CallType, source: impl Into<String>)
Pushes a new frame onto the stack.
§Arguments
call_type- The type of script call (sourced or executed).source- The source of the script (e.g., file path).
Sourcepub fn in_sourced_script(&self) -> bool
pub fn in_sourced_script(&self) -> bool
Returns whether or not the current script stack frame is a sourced script.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CallStack
impl RefUnwindSafe for CallStack
impl Send for CallStack
impl Sync for CallStack
impl Unpin for CallStack
impl UnwindSafe for CallStack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more