reinhardt-di 0.2.2

Dependency injection system for Reinhardt, inspired by FastAPI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Inner value access trait for extractor wrappers

/// Trait for extractors that wrap a single inner value.
///
/// Enables `Validated<E>` to access the inner value for validation
/// without knowing the concrete extractor type.
///
/// Implemented by `Form<T>`, `Json<T>`, and `Query<T>`.
pub trait HasInner {
	/// The wrapped inner type.
	type Inner;

	/// Borrow the inner value.
	fn inner_ref(&self) -> &Self::Inner;

	/// Consume the extractor and return the inner value.
	fn into_inner(self) -> Self::Inner;
}