Expand description

C FFI - va_list support

This crate provides an interface for rust code to read values passed in C’s va_list type.


In C Code

#include <stdint.h>
#include <stdarg.h>
extern void print_ints_va(uint32_t count, va_list args);
extern void print_ints(uint32_t count, ...)
  va_list args;
  va_start(args, count);
  print_ints_va(count, args);

In rust code:

extern crate va_list;

extern "C" fn print_ints_va(count: u32, mut args: va_list::VaList)
  unsafe {
    for i in (0 .. count) {
      println!("{}: {}", i, args.get::<i32>());


Rust version of C’s va_list type from the stdarg.h header


Trait implemented on types that can be read from a va_list