Trait FromFFI

Source
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§

Source

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.

Implementations on Foreign Types§

Source§

impl FromFFI for [u8; 32]

Source§

fn parse_ffi<'a>(s: impl Into<Cow<'a, str>>) -> Self

Source§

impl FromFFI for [u8; 64]

Source§

fn parse_ffi<'a>(s: impl Into<Cow<'a, str>>) -> Self

Source§

impl<T: FromFFI> FromFFI for Option<T>

Source§

fn parse_ffi<'a>(s: impl Into<Cow<'a, str>>) -> Self

Implementors§