| [ Web Proxy ] |
| Viewing: https://doc.rust-lang.org/std/string/trait.ToString.html | [Back] [Original] |
pub trait ToString {
// Required method
fn to_string(&self) -> String;
}Expand descriptionA trait for converting a value to a String.
This trait is automatically implemented for any type which implements the
Display trait. As such, ToString shouldnt be implemented directly:
Display should be implemented instead, and you get the ToString
implementation for free.
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
| Web Proxy Viewer | New URL | Original Page |