mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-07 12:16:44 +01:00
extact dsl_token; flip Dsl; try to obviate ViewContext
This commit is contained in:
parent
f08593f0f8
commit
f797a7143d
12 changed files with 264 additions and 209 deletions
|
|
@ -3,7 +3,7 @@ use crate::*;
|
|||
#[cfg(feature = "dsl")]
|
||||
#[macro_export] macro_rules! try_delegate {
|
||||
($s:ident, $dsl:expr, $T:ty) => {
|
||||
let value: Option<$T> = FromDsl::take_from($s, $dsl)?;
|
||||
let value: Option<$T> = Dsl::take_from($s, $dsl)?;
|
||||
if let Some(value) = value {
|
||||
return Ok(Some(value.boxed()))
|
||||
}
|
||||
|
|
@ -12,10 +12,10 @@ use crate::*;
|
|||
|
||||
// Provides components to the view.
|
||||
#[cfg(feature = "dsl")]
|
||||
pub trait ViewContext<'state, E: Output + 'state>: Send + Sync
|
||||
+ Dsl<bool>
|
||||
+ Dsl<usize>
|
||||
+ Dsl<E::Unit>
|
||||
pub trait ViewContext<'state, E: Output + 'state>: Send + Sync where
|
||||
bool: Dsl<Self>,
|
||||
usize: Dsl<Self>,
|
||||
E::Unit: Dsl<Self>,
|
||||
{
|
||||
fn get_content_or_fail <'source: 'state> (&'state self, iter: &mut TokenIter<'source>)
|
||||
-> Usually<RenderBox<'state, E>>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue