Trait AsCppString

Source
pub trait AsCppString {
    // Required method
    fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O;
}
Expand description

Defines type’s ability to produce temporary &StdString

This ensures the most efficient interface, since existing StdString can just provide reference to itself, while &CStr, &str, std::string::String, etc. can allocate temporary StdString on stack via crate::container::RefContainer

Required Methods§

Source

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Consumes the value, providing reference to temporary StdString

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.

Implementations on Foreign Types§

Source§

impl AsCppString for &&Cow<'_, str>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Cow<'_, CStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Cow<'_, OsStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Cow<'_, Path>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Cow<'_, [u8]>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&str

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Box<str>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Box<CStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Box<OsStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Box<Path>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Box<[u8]>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&CString

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&String

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Vec<u8>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&CStr

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&OsStr

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&OsString

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&Path

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&PathBuf

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &&[u8]

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Cow<'_, str>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Cow<'_, CStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Cow<'_, OsStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Cow<'_, Path>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Cow<'_, [u8]>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &str

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Box<str>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Box<CStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Box<OsStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Box<Path>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Box<[u8]>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &CString

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &String

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Vec<u8>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &CStr

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &OsStr

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &OsString

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &Path

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &PathBuf

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for &[u8]

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Cow<'_, str>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Cow<'_, CStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Cow<'_, OsStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Cow<'_, Path>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Cow<'_, [u8]>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for str

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Box<str>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Box<CStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Box<OsStr>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Box<Path>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Box<[u8]>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for CString

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for String

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Vec<u8>

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for CStr

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for OsStr

Available on crate feature std only.
Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for OsString

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for Path

Available on crate feature std only.
Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for PathBuf

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl AsCppString for [u8]

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl<const N: usize> AsCppString for &&[u8; N]

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl<const N: usize> AsCppString for &[u8; N]

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Source§

impl<const N: usize> AsCppString for [u8; N]

Source§

fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O

Implementors§