Coercions
摘要
This chapter focuses on the concept of type coercion in Rust, a powerful mechanism that allows one type to be automatically converted into another when certain conditions are met. It begins by exploring the basics of coercion, including the widely used deref coercion, which enables seamless access between smart pointers, references, and owned types. The discussion then moves to various coercion sites, identifying where and how coercions occur in code.