pub trait StrIO {
// Required methods
fn to_str(&self) -> String;
fn from_str(s: &str) -> Self;
}
Expand description
将数据从原来的形式与字符串形式之间进行转换
对基础的数字类型、String进行了实现
对于其他自定义类型,需要手动实现该trait
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.