Rust · Trait
From
From converts a consumed value into another type without failure. Implement it for clear, lossless, value-preserving conversions; use TryFrom when conversion can fail.
Last updated
- Since
- 1.0.0
Syntax
pub trait From<T>: Sized {
fn from(value: T) -> Self;
}In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
IntoTryFromTryIntoAsRefAsMutResult