pub struct FixtureInit<T> {
pub resource: Arc<T>,
pub teardown: Option<Box<dyn FnOnce() + Send + 'static>>,
}Expand description
The result of normalising a fixture’s init return value.
Returning T gives no teardown; returning (T, teardown) registers a
synchronous teardown closure run when the scope ends.
Fields§
§resource: Arc<T>The shared resource.
teardown: Option<Box<dyn FnOnce() + Send + 'static>>Optional teardown run when the scope ends.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for FixtureInit<T>
impl<T> !Sync for FixtureInit<T>
impl<T> !UnwindSafe for FixtureInit<T>
impl<T> Freeze for FixtureInit<T>
impl<T> Send for FixtureInit<T>
impl<T> Unpin for FixtureInit<T>
impl<T> UnsafeUnpin for FixtureInit<T>where
Arc<T>: UnsafeUnpin,
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> IntoFixture<T> for T
impl<T> IntoFixture<T> for T
Source§fn into_fixture(self) -> FixtureInit<T>
fn into_fixture(self) -> FixtureInit<T>
Convert this init result into a
FixtureInit.