pub trait ParamRef<T> {
// Required method
fn param_ref(&self) -> &T;
}Expand description
Item of type T has been set in a certain_map slot and returns a reference.
When used as a trait bound, ParamRef<T> ensures that the constrained type implements the
param_ref method, which returns a reference to the value of type T. This allows the
caller to ensure that the value of T has been set in a certain_map slot and that a
reference to it can be retrieved.
§Example
fn process_param_ref<P: ParamRef<T>, T>(param_provider: &P) {
let value_ref: &T = param_provider.param_ref();
// Use the reference to the value of type T
}