pub struct Stack { /* private fields */ }
Expand description
The stack itself.
Implementations§
source§impl Stack
impl Stack
sourcepub fn pop(&mut self) -> Option<Value>
pub fn pop(&mut self) -> Option<Value>
Returns the top value of the stack, popping it.
§Returns
The top value of the stack, or None if the stack (slice) is empty.
sourcepub fn push_pop_marker(&mut self) -> Result<(), Error>
pub fn push_pop_marker(&mut self) -> Result<(), Error>
Pushes a new pop marker on top of the stack.
§Errors
This function may error if the stack is growing too large.
sourcepub fn insert<V: Into<Value>>(
&mut self,
index: usize,
value: V,
) -> Result<(), Error>
pub fn insert<V: Into<Value>>( &mut self, index: usize, value: V, ) -> Result<(), Error>
Inserts a new value at the given position in the stack.
§Generic arguments
V
: The Value-compatible type of thevalue
.
§Arguments
index
: The position in which to insert the value. Any values following (and including) this index will be shifted one place to the right.value
: The value to push onto the stack.
§Errors
This function may error if the stack is growing too large.
Methods from Deref<Target = StackSlice>§
sourcepub fn peek(&self) -> Option<&Value>
pub fn peek(&self) -> Option<&Value>
Returns the top value of the stack without popping it.
§Returns
The top value of the stack, or None if the stack (slice) is empty.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether this slice is empty or not (i.e., has zero-length)
Trait Implementations§
source§impl Borrow<StackSlice> for Stack
impl Borrow<StackSlice> for Stack
source§fn borrow(&self) -> &StackSlice
fn borrow(&self) -> &StackSlice
Immutably borrows from an owned value. Read more
source§impl BorrowMut<StackSlice> for Stack
impl BorrowMut<StackSlice> for Stack
source§fn borrow_mut(&mut self) -> &mut StackSlice
fn borrow_mut(&mut self) -> &mut StackSlice
Mutably borrows from an owned value. Read more
source§impl<'a> IntoIterator for &'a Stack
impl<'a> IntoIterator for &'a Stack
source§impl<'a> IntoIterator for &'a mut Stack
impl<'a> IntoIterator for &'a mut Stack
source§impl IntoIterator for Stack
impl IntoIterator for Stack
Auto Trait Implementations§
impl Freeze for Stack
impl RefUnwindSafe for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnwindSafe for Stack
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request