From & Into
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
From dhe Into janë trait-et e Rust-it për konvertime: po zbatove From<&str> for Emri, mund të shkruash Emri::from("Arta") ose "Arta".into(). Operatori ? i përdor për të konvertuar gabimet vetë.
EnglishEN
From and Into are Rust's conversion traits: implement From<&str> for Name and you can write Name::from("Arta") or "Arta".into(). The ? operator uses them to convert errors automatically.
Si ta mendosh
Si një përkthyes që e di si ta kthejë një gjë në tjetrën.
Lexoje në anglisht
Like a translator who knows how to turn one thing into another.
Shembull kodirust
let s: String = "Arta".into();
let n: i64 = i64::from(42i32);