Skip to main content

VaArgSafe

Trait VaArgSafe 

Source
pub unsafe trait VaArgSafe: Copy + Sealed { }
🔬This is a nightly-only experimental API. (c_variadic #44930)
Expand description

Types that are valid to read using VaList::next_arg.

This trait is implemented for primitive types that have a variable argument application-binary interface (ABI) on the current platform. It is always implemented for:

Implementations for e.g. i32 or usize shouldn’t be relied upon directly, because they may not be available on all platforms.

§Safety

When C passes variable arguments, signed integers smaller than c_int are promoted to c_int, unsigned integers smaller than c_uint are promoted to c_uint, and c_float is promoted to c_double. Implementing this trait for types that are subject to this promotion rule is invalid.

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.

Implementors§