[−][src]Struct lofi::Conduit
A conduit that allows access to a state provided in Executor::tick()
.
Use Executor::get_conduit()
to create.
Implementations
impl Conduit
[src]
pub fn with<T, F, R>(&self, action: F) -> R where
T: UniversalTypeId,
F: FnOnce(&T) -> R,
[src]
T: UniversalTypeId,
F: FnOnce(&T) -> R,
Perform action
on a tick state state immutably accessed by this conduit.
pub async fn with_mut<T, F, R>(self, action: F) -> R where
T: UniversalTypeId,
F: FnOnce(&mut T) -> R,
[src]
T: UniversalTypeId,
F: FnOnce(&mut T) -> R,
Perform action
on the state exclusively accessed by this conduit.
Returns a future that, upon awaiting on it, puts the fiber into an "exclusive access" mode, guaranteeing that no other fibers are using a tick state.
pub fn spawn<F>(self, task: F) where
F: Future<Output = ()> + Send + Sync + 'static,
[src]
F: Future<Output = ()> + Send + Sync + 'static,
Spawn a new future in current executor.
pub fn spawn_ret<F, T>(self, task: F) -> JoinHandle<T>ⓘNotable traits for JoinHandle<T>
impl<T: Send + 'static> Future for JoinHandle<T> type Output = T;
where
F: Future<Output = T> + Send + Sync + 'static,
T: Send + 'static,
[src]
Notable traits for JoinHandle<T>
impl<T: Send + 'static> Future for JoinHandle<T> type Output = T;
F: Future<Output = T> + Send + Sync + 'static,
T: Send + 'static,
Spawn a new future in current executor. Allows awaiting for completion.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Conduit
impl Send for Conduit
impl Sync for Conduit
impl Unpin for Conduit
impl UnwindSafe for Conduit
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,