Something like the context package in Go

Does anyone know of the simplest way (e.g. a crate, I'm thinking maybe a Tokio crate like http2) to have something like the context package in Go? I need it to develop a gossipsub protocol for rust-libp2p, in order to develop an Ethereum sharding p2p network for my project.

Found this context crate.