pub trait FreeForeign {
type Foreign;
// Required method
unsafe fn free_foreign(p: *mut Self::Foreign);
}Expand description
A type for which there is a canonical representation as a C datum.
Required Associated Types§
Required Methods§
Sourceunsafe fn free_foreign(p: *mut Self::Foreign)
unsafe fn free_foreign(p: *mut Self::Foreign)
Free the C datum pointed to by p.
§Safety
p must be NULL or point to valid data.
let foreign = "Hello, world!".clone_to_foreign();
unsafe {
String::free_foreign(foreign.into_inner());
}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.