conversion

From and Into for type conversions

The From and Into traits provide a standard way to convert between types. Implementing From<T> for your type automatically provides Into<T> via a blanket implementation. I use From for infallible conversions (like String::from("hello")) an

AsRef and AsMut for flexible function parameters

AsRef<T> is a trait for cheap reference-to-reference conversion. It's commonly used in function parameters to accept multiple types. For example, a function taking impl AsRef<Path> can accept &Path, PathBuf, &str, or String. This i