Module conversions

Module conversions 

Source
Expand description

Type conversions between C ABI types and Rust types

These functions provide safe wrappers around unsafe FFI operations.

Structs§

CPacketRepr

Functions§

audio_format_from_c
Convert C AudioFormat to Rust
audio_format_to_c
Convert Rust AudioFormat to C
c_str_to_string
Convert C string to Rust String
error_to_c
Convert an error message to a C string for returning across the C ABI.
free_c_string
Free a C string created by string_to_c.
packet_from_c
Convert C packet to Rust Packet
packet_to_c
Convert Rust Packet to C representation.
packet_type_from_c
Convert C packet type info to Rust PacketType
packet_type_to_c
Convert Rust PacketType to C representation Returns (CPacketTypeInfo, optional CAudioFormat that must be kept alive) For RawAudio types, the returned CAudioFormat must outlive the CPacketTypeInfo
sample_format_from_c
Convert C sample format to Rust
sample_format_to_c
Convert Rust SampleFormat to C
string_to_c
Convert Rust string to C string (caller must free)