pub struct Scope<'a> {
pub data: &'a DataModel,
pub path: String,
pub index: Option<usize>,
pub catalog: Option<String>,
pub activation: bool,
/* private fields */
}Expand description
Where an expression is evaluated.
Fields§
§data: &'a DataModelThe surface’s data model.
path: StringThe data context a relative path resolves against (/ at the root, the
item’s path inside a template).
index: Option<usize>The innermost template’s item index, for @index.
catalog: Option<String>The catalog a call without its own catalogId resolves in.
activation: boolWhether this runs from a user gesture (an action), which functions that need one require.
Implementations§
Source§impl<'a> Scope<'a>
impl<'a> Scope<'a>
Sourcepub fn root(data: &'a DataModel, catalog: Option<&str>) -> Self
pub fn root(data: &'a DataModel, catalog: Option<&str>) -> Self
The root scope of a surface whose default catalog is catalog.
Sourcepub fn take_effects(&self) -> Vec<Effect>
pub fn take_effects(&self) -> Vec<Effect>
The effects functions asked for, in order, taken out of the scope.
Auto Trait Implementations§
impl<'a> !Freeze for Scope<'a>
impl<'a> !RefUnwindSafe for Scope<'a>
impl<'a> !Sync for Scope<'a>
impl<'a> Forget for Scope<'a>
impl<'a> Move for Scope<'a>
impl<'a> Send for Scope<'a>
impl<'a> Unpin for Scope<'a>
impl<'a> UnsafeUnpin for Scope<'a>where
&'a DataModel: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Effect>: UnsafeUnpin,
impl<'a> UnwindSafe for Scope<'a>
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