Module convert

Traits for conversions between types.

The traits in this module provide a way to convert from one type to another type. Each trait serves a different purpose:

The traits in this module are often used as trait bounds for generic functions such that to arguments of multiple types are supported. See the documentation of each trait for examples.

As a library author, you should always prefer implementing [From<T>]From or [TryFrom<T>]TryFrom rather than [Into<U>]Into or [TryInto<U>]TryInto, as From and TryFrom provide greater flexibility and offer equivalent Into or TryInto implementations for free, thanks to a blanket implementation in the standard library. When targeting a version prior to Rust 1.41, it may be necessary to implement Into or TryInto directly when converting to a type outside the current crate.

Generic Implementations

See each trait for usage examples.

Enums

Traits

Functions