/// Task metadata supplied to user-provided hooks for task events. /// /// **Note**: This is an [unstable API][unstable]. The public API of this type /// may break in 1.x releases. See [the documentation on unstable /// features][unstable] for details. /// /// [unstable]: crate#unstable-features #[allow(missing_debug_implementations)] #[cfg_attr(not(tokio_unstable), allow(unreachable_pub))] pubstruct TaskMeta<'a> { /// The opaque ID of the task. pub(crate) id: super::task::Id, /// The location where the task was spawned. #[cfg_attr(not(tokio_unstable), allow(unreachable_pub, dead_code))] pub(crate) spawned_at: crate::runtime::task::SpawnLocation, pub(crate) _phantom: PhantomData<&'a ()>,
}
impl<'a> TaskMeta<'a> { /// Return the opaque ID of the task. #[cfg_attr(not(tokio_unstable), allow(unreachable_pub, dead_code))] pubfn id(&self) -> super::task::Id { self.id
}
/// Return the source code location where the task was spawned. #[cfg(tokio_unstable)] pubfn spawned_at(&self) -> &'static std::panic::Location<'static> { self.spawned_at.0
}
}
/// Runs on specific task-related events pub(crate) type TaskCallback = std::sync::Arc<dynFn(&TaskMeta<'_>) + Send + Sync>;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.