Struct VaList
struct VaList<'a> { ... }
A variable argument list, ABI-compatible with va_list in C.
This type is created in c-variadic functions when ... is desugared. A VaList
is automatically initialized (equivalent to calling va_start in C).
use VaList;
/// # Safety
/// Must be passed at least `count` arguments of type `i32`.
unsafe extern "C"
/// # Safety
/// Must be passed at least `count` arguments of type `i32`.
unsafe
assert_eq!;
assert_eq!;
The VaList::arg method can be used to read an argument from the list. This method
automatically advances the VaList to the next argument. The C equivalent is va_arg.
Cloning a VaList performs the equivalent of C va_copy, producing an independent cursor
that arguments can be read from without affecting the original. Dropping a VaList performs
the equivalent of C va_end.
This can be used across an FFI boundary, and fully matches the platform's va_list.
Implementations
impl<'f> VaList<'f>
unsafe const fn arg<T: VaArgSafe>(self: &mut Self) -> TRead an argument from the variable argument list, and advance to the next argument.
Only types that implement
VaArgSafecan be read from a variable argument list.Safety
This function is only sound to call when there is another argument to read, and that argument is a properly initialized value of the type
T.Calling this function with an incompatible type, an invalid value, or when there are no more variable arguments, is unsound.
impl Debug for VaList<'_>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<'a> Freeze for VaList<'a>
impl<'a> RefUnwindSafe for VaList<'a>
impl<'a> Send for VaList<'a>
impl<'a> Sync for VaList<'a>
impl<'a> Unpin for VaList<'a>
impl<'a> UnsafeUnpin for VaList<'a>
impl<'a> UnwindSafe for VaList<'a>
impl<'f> Clone for VaList<'f>
fn clone(self: &Self) -> Self
impl<'f> Drop for VaList<'f>
fn drop(self: &mut Self)
impl<T> Any for VaList<'a>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for VaList<'a>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for VaList<'a>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for VaList<'a>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for VaList<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for VaList<'a>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for VaList<'a>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for VaList<'a>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>