pub struct Facade { /* private fields */ }Expand description
Visits world resources from async systems.
A facade is a window into the world, by which an async system can interact
with the world through Facade::visit, without causing resource
contention.
Implementations
sourceimpl Facade
impl Facade
sourcepub async fn visit<D: CanFetch + Send + Sync + 'static, T: Send + Sync + 'static>(
&mut self,
f: impl FnOnce(D) -> Result<T>
) -> Result<T>
pub async fn visit<D: CanFetch + Send + Sync + 'static, T: Send + Sync + 'static>(
&mut self,
f: impl FnOnce(D) -> Result<T>
) -> Result<T>
Asyncronously visit fetchable system resources using a closure.
The closure may return data to the caller.
A roundtrip takes at most one frame.
Note: Using a closure ensures that no fetched system resources are held over an await point, which would preclude other systems from accessing them and susequently being able to run.
Auto Trait Implementations
impl RefUnwindSafe for Facade
impl Send for Facade
impl Sync for Facade
impl Unpin for Facade
impl UnwindSafe for Facade
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more