Trait Arg
trait Arg
A trait for passing path arguments.
This is similar to AsRef<Path>, but is implemented for more
kinds of strings and can convert into more kinds of strings.
Examples
#
use CStr;
use io;
#
use Arg;
#
#
Users can then call touch("foo"), touch(cstr!("foo")),
touch(Path::new("foo")), or many other things.
Required Methods
fn as_str(self: &Self) -> Result<&str>Returns a view of this string as a string slice.
fn to_string_lossy(self: &Self) -> Cow<'_, str>Returns a potentially-lossy rendering of this string as a
Cow<'_, str>.fn as_cow_c_str(self: &Self) -> Result<Cow<'_, CStr>>Returns a view of this string as a maybe-owned
CStr.fn into_c_str<'b>(self: Self) -> Result<Cow<'b, CStr>> where Self: 'bConsumes
selfand returns a view of this string as a maybe-ownedCStr.fn into_with_c_str<T, F>(self: Self, f: F) -> Result<T> where Self: Sized, F: FnOnce(&CStr) -> Result<T>Runs a closure with
selfpassed in as a&CStr.
Implementors
impl Arg for &CStrimpl Arg for &[u8]impl Arg for &Stringimpl Arg for &OsStringimpl Arg for &PathBufimpl Arg for &CStringimpl Arg for &Vec<u8>impl Arg for Stringimpl Arg for CStringimpl<'a> Arg for Iter<'a>impl Arg for Vec<u8>impl Arg for &OsStrimpl<'a> Arg for Cow<'a, str>impl Arg for DecIntimpl<'a> Arg for Cow<'a, OsStr>impl<'a> Arg for Components<'a>impl<'a> Arg for Cow<'a, CStr>impl<'a> Arg for Component<'a>impl Arg for OsStringimpl Arg for PathBufimpl Arg for &strimpl Arg for &Path