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§
Sourcefn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
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>
impl AsCppString for &&Cow<'_, str>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Cow<'_, CStr>
impl AsCppString for &&Cow<'_, CStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Cow<'_, OsStr>
impl AsCppString for &&Cow<'_, OsStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Cow<'_, Path>
impl AsCppString for &&Cow<'_, Path>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Cow<'_, [u8]>
impl AsCppString for &&Cow<'_, [u8]>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&str
impl AsCppString for &&str
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Box<str>
impl AsCppString for &&Box<str>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Box<CStr>
impl AsCppString for &&Box<CStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Box<OsStr>
impl AsCppString for &&Box<OsStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Box<Path>
impl AsCppString for &&Box<Path>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Box<[u8]>
impl AsCppString for &&Box<[u8]>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&CString
impl AsCppString for &&CString
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&String
impl AsCppString for &&String
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Vec<u8>
impl AsCppString for &&Vec<u8>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&CStr
impl AsCppString for &&CStr
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&OsStr
impl AsCppString for &&OsStr
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&OsString
impl AsCppString for &&OsString
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&Path
impl AsCppString for &&Path
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&PathBuf
impl AsCppString for &&PathBuf
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &&[u8]
impl AsCppString for &&[u8]
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Cow<'_, str>
impl AsCppString for &Cow<'_, str>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Cow<'_, CStr>
impl AsCppString for &Cow<'_, CStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Cow<'_, OsStr>
impl AsCppString for &Cow<'_, OsStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Cow<'_, Path>
impl AsCppString for &Cow<'_, Path>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Cow<'_, [u8]>
impl AsCppString for &Cow<'_, [u8]>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &str
impl AsCppString for &str
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Box<str>
impl AsCppString for &Box<str>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Box<CStr>
impl AsCppString for &Box<CStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Box<OsStr>
impl AsCppString for &Box<OsStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Box<Path>
impl AsCppString for &Box<Path>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Box<[u8]>
impl AsCppString for &Box<[u8]>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &CString
impl AsCppString for &CString
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &String
impl AsCppString for &String
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Vec<u8>
impl AsCppString for &Vec<u8>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &CStr
impl AsCppString for &CStr
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &OsStr
impl AsCppString for &OsStr
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &OsString
impl AsCppString for &OsString
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &Path
impl AsCppString for &Path
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &PathBuf
impl AsCppString for &PathBuf
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for &[u8]
impl AsCppString for &[u8]
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Cow<'_, str>
impl AsCppString for Cow<'_, str>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Cow<'_, CStr>
impl AsCppString for Cow<'_, CStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Cow<'_, OsStr>
impl AsCppString for Cow<'_, OsStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Cow<'_, Path>
impl AsCppString for Cow<'_, Path>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Cow<'_, [u8]>
impl AsCppString for Cow<'_, [u8]>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for str
impl AsCppString for str
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Box<str>
impl AsCppString for Box<str>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Box<CStr>
impl AsCppString for Box<CStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Box<OsStr>
impl AsCppString for Box<OsStr>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Box<Path>
impl AsCppString for Box<Path>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Box<[u8]>
impl AsCppString for Box<[u8]>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for CString
impl AsCppString for CString
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for String
impl AsCppString for String
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Vec<u8>
impl AsCppString for Vec<u8>
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for CStr
impl AsCppString for CStr
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for OsStr
Available on crate feature std only.
impl AsCppString for OsStr
Available on crate feature
std only.fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for OsString
impl AsCppString for OsString
fn with_cpp_string<O>(&self, op: impl FnOnce(&StdString) -> O) -> O
Source§impl AsCppString for Path
Available on crate feature std only.
impl AsCppString for Path
Available on crate feature
std only.