# Pre-RFC: typed context injection

**URL:** <https://internals.rust-lang.org/t/pre-rfc-typed-context-injection/19579>\
**Category:** language design\
**Created:** [September 16, 2023, 9:36pm UTC](https://internals.rust-lang.org/t/pre-rfc-typed-context-injection/19579 "2023-09-16T21:36:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jplatte](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jplatte/32/11437_2.png) [@jplatte](https://internals.rust-lang.org/u/jplatte)\
**Post date:** [September 17, 2023, 7:40am UTC](https://internals.rust-lang.org/t/pre-rfc-typed-context-injection/19579/2 "2023-09-17T07:40:23Z")

</div>

This sounds to me like a less general version of this older idea:

> [@Blog post: Contexts and capabilities in Rust](https://internals.rust-lang.org/t/blog-post-contexts-and-capabilities-in-rust/15833):
>
> Comment thread for my post, [Context and capabilities in Rust](https://tmandry.gitlab.io/blog/posts/2021-12-21-context-capabilities/). What if Rust code could instead declare the context it needs, and the compiler took care of making sure that context was provided? This general concept is addressed by a few different approaches in other languages: Dependency injection Implicit arguments Effects The approach proposed here works like implicit arguments, with some syntactic and conceptual similarities to effects in other languages that make it both more convenient…

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-typed-context-injection/19579)._
