mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
relax Send + Sync constraint on Renderables; remove 3 format calls from render loop
maybe render should have mutable access after all?
This commit is contained in:
parent
209f35440a
commit
680a841e3f
5 changed files with 58 additions and 55 deletions
|
|
@ -12,9 +12,9 @@ impl<E: Output, T: Render<E>, F: Fn()->T + Send + Sync> Content<E> for Thunk<E,
|
|||
fn content (&self) -> impl Render<E> { (self.1)() }
|
||||
}
|
||||
|
||||
pub struct ThunkBox<'a, E: Output>(PhantomData<E>, Box<dyn Fn()->Box<dyn Render<E> + 'a> + Send + Sync + 'a>);
|
||||
pub struct ThunkBox<'a, E: Output>(PhantomData<E>, Box<dyn Fn()->RenderBox<'a, E> + Send + Sync + 'a>);
|
||||
impl<'a, E: Output> ThunkBox<'a, E> {
|
||||
pub fn new (thunk: Box<dyn Fn()->Box<dyn Render<E> + 'a> + Send + Sync + 'a>) -> Self {
|
||||
pub fn new (thunk: Box<dyn Fn()->RenderBox<'a, E> + Send + Sync + 'a>) -> Self {
|
||||
Self(Default::default(), thunk)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue