pub(crate) trait FromFFI: Sized {
// Required method
fn parse_ffi<'a>(s: impl Into<Cow<'a, str>>) -> Self;
}Expand description
Trait for types that can be parsed from FFI string data.
This trait enables conversion from C strings (received via FFI) back into Rust types. It’s used for parsing return values from C functions
Required Methods§
Sourcefn parse_ffi<'a>(s: impl Into<Cow<'a, str>>) -> Self
fn parse_ffi<'a>(s: impl Into<Cow<'a, str>>) -> Self
Parses this type from an FFI string representation.
The input can be either a borrowed string slice or an owned string,
provided via the Cow type for flexibility.
§Panics
Implementations may panic if the input string is malformed, indicating a FFI implementation bug
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.