Add BoxedSencSync which is Send + Sync
This commit is contained in:
parent
968dbe501f
commit
f414db40d5
2 changed files with 77 additions and 44 deletions
|
|
@ -1,8 +1,8 @@
|
|||
use async_trait::async_trait;
|
||||
|
||||
use crate::widgets::{
|
||||
Background, Border, Boxed, BoxedAsync, Desync, Either2, Either3, Float, JoinSegment, Layer2,
|
||||
Padding, Resize,
|
||||
Background, Border, Boxed, BoxedAsync, BoxedSendSync, Desync, Either2, Either3, Float,
|
||||
JoinSegment, Layer2, Padding, Resize,
|
||||
};
|
||||
use crate::{Frame, Size, WidthDb};
|
||||
|
||||
|
|
@ -47,6 +47,13 @@ pub trait WidgetExt: Sized {
|
|||
Boxed::new(self)
|
||||
}
|
||||
|
||||
fn boxed_send_sync<'a, E>(self) -> BoxedSendSync<'a, E>
|
||||
where
|
||||
Self: Widget<E> + Send + Sync + 'a,
|
||||
{
|
||||
BoxedSendSync::new(self)
|
||||
}
|
||||
|
||||
fn boxed_async<'a, E>(self) -> BoxedAsync<'a, E>
|
||||
where
|
||||
Self: AsyncWidget<E> + Send + Sync + 'a,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue