Trait PathLike

Source
pub trait PathLike: Sealed {
    // Required method
    fn to_string_lossy(&self) -> Cow<'_, str>;
}
Expand description

A trait that abstracts over types accepted for conversion to the most featureful path representation possible; that is:

  • When no_std is active, this is implemented for:
  • Otherwise, types that implement AsRef<Path> (to extract a &Path).

This type is used as the type bounds for various diagnostic rendering methods, i.e., WithSpan::emit_to_string_with_path.

Required Methods§

Source

fn to_string_lossy(&self) -> Cow<'_, str>

Implementors§

Source§

impl<T: AsRef<Path> + ?Sized> PathLike for T