pub struct SyncWrapper<T> { /* private fields */ }
Expand description
异步操作的同步包装器
提供一个安全的方式在同步代码中调用异步操作
Implementations§
Source§impl<T> SyncWrapper<T>
impl<T> SyncWrapper<T>
Source§impl<T: Send + 'static> SyncWrapper<EventBus<T>>
为事件总线提供同步包装
impl<T: Send + 'static> SyncWrapper<EventBus<T>>
为事件总线提供同步包装
Sourcepub fn broadcast_auto(&self, event: T) -> ForgeResult<()>
pub fn broadcast_auto(&self, event: T) -> ForgeResult<()>
同步广播事件(自动选择最佳方法)
Sourcepub fn destroy_auto(&self) -> ForgeResult<()>
pub fn destroy_auto(&self) -> ForgeResult<()>
同步销毁事件总线(自动选择最佳方法)
Auto Trait Implementations§
impl<T> Freeze for SyncWrapper<T>where
T: Freeze,
impl<T> RefUnwindSafe for SyncWrapper<T>where
T: RefUnwindSafe,
impl<T> Send for SyncWrapper<T>where
T: Send,
impl<T> Sync for SyncWrapper<T>where
T: Sync,
impl<T> Unpin for SyncWrapper<T>where
T: Unpin,
impl<T> UnwindSafe for SyncWrapper<T>where
T: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more