pub struct StackHandle<T: ?Sized> { /* private fields */ }Expand description
A handle to an enclosed value.
For as long as the Scope is still valid access to the
reference can be temporarily fetched via the with
method. Doing so after the scope is gone, this will panic on all
operations.
To check if a handle is still valid is_valid
can be used.
A stack handle implements the underlying object protocols from MiniJinja.
Implementations§
Trait Implementations§
Source§impl<T: Object + ?Sized> Object for StackHandle<T>
impl<T: Object + ?Sized> Object for StackHandle<T>
Source§impl<T: StructObject + Send + Sync + 'static + ?Sized> StructObject for StackHandle<T>
impl<T: StructObject + Send + Sync + 'static + ?Sized> StructObject for StackHandle<T>
Source§fn get_field(&self, idx: &str) -> Option<Value>
fn get_field(&self, idx: &str) -> Option<Value>
Invoked by the engine to get a field of a struct. Read more
Source§fn static_fields(&self) -> Option<&'static [&'static str]>
fn static_fields(&self) -> Option<&'static [&'static str]>
If possible returns a static vector of field names. Read more
Source§fn field_count(&self) -> usize
fn field_count(&self) -> usize
Returns the number of fields. Read more
impl<T: Send + ?Sized> Send for StackHandle<T>
impl<T: Sync + ?Sized> Sync for StackHandle<T>
Auto Trait Implementations§
impl<T> Freeze for StackHandle<T>where
T: ?Sized,
impl<T> RefUnwindSafe for StackHandle<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for StackHandle<T>where
T: ?Sized,
impl<T> UnwindSafe for StackHandle<T>where
T: RefUnwindSafe + ?Sized,
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