pub trait TupFrom<T>: Sealed {
// Required method
fn from_tup(_: T) -> Self;
}Expand description
A copy of the From trait from the standard library. The From trait could unfortunately
not be used due to it’s type reflexivity which clashed with the Tup implementation.
This trait is sealed as it should only ever be implemented on the Tup type.
For more information please look at the TupInto trait.
#[tup_default]
pub fn main() {
let rick = tup!(funny: true);
let rick = <Tup!(funny: bool, lyrics: &'static str = "Never Gonna Give You Up...")>::from_tup(rick);
assert_eq!(rick, tup!(funny: true, lyrics: "Never Gonna Give You Up..."))
}Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.