TryFrom
和 TryInto
与 From
和 Into
类似,TryFrom
和 TryInto
是用于类型转换的泛型特质。与 From
/Into
不同,TryFrom
/TryInto
特质用于可能失败的转换,因此返回 Result
。
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
TryFrom
和 TryInto
与 From
和 Into
类似,TryFrom
和 TryInto
是用于类型转换的泛型特质。与 From
/Into
不同,TryFrom
/TryInto
特质用于可能失败的转换,因此返回 Result
。