pub struct Facade { /* private fields */ }Expand description
A Facade visits world resources from async futures.
A facade is a window into the world, by which an async future can interact
with the world’s resources through Facade::visit, without causing resource
contention with each other or the world’s systems.
Implementations§
Source§impl Facade
impl Facade
Sourcepub async fn visit<D: Edges + Send + Sync + 'static, T>(
&mut self,
f: impl FnOnce(D) -> T,
) -> Result<T, GraphError>
pub async fn visit<D: Edges + Send + Sync + 'static, T>( &mut self, f: impl FnOnce(D) -> T, ) -> Result<T, GraphError>
Asyncronously visit system resources using a closure.
The closure may return data to the caller.
Note: Using a closure ensures that no fetched system resources are
held over an await point, which would preclude world systems and other
Facades from accessing them and susequently being able to run.
pub async fn visit_world_mut<T>( &mut self, f: impl FnOnce(&mut World) -> T + Send + Sync + 'static, ) -> Result<T, GraphError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Facade
impl RefUnwindSafe for Facade
impl Send for Facade
impl Sync for Facade
impl Unpin for Facade
impl UnwindSafe for Facade
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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