Skip to main content

FromRef

Trait FromRef 

pub trait FromRef<T> {
    // Required method
    fn from_ref(input: &T) -> Self;
}
Expand description

Create Self from a reference T

This is mostly used for extractors, but it can be used for anything that needs to create an owned type from a reference

Required Methods§

fn from_ref(input: &T) -> Self

Converts to this type from a reference to the input type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl<T> FromRef<T> for T
where T: Clone,