Trait VarArgs

Source
pub trait VarArgs: Clone {
    type OneMore<T: Clone>: VarArgs;

    const CHECK: () = ();

    // Required methods
    fn append<T: Clone>(self, val: T) -> Self::OneMore<T>;
    unsafe fn call_printf(
        self,
        format_str: *const c_uchar,
        log_level_str: *const c_uchar,
    ) -> c_int;
}
Expand description

Represents a variable length list of arguments to printf.

See module level docs for a detailed description on how how VarArgs works and is used.

Provided Associated Constants§

Source

const CHECK: () = ()

Used to check if there is space left in the argument list.

If the there is no space left in the argument list an Arguments<T>’s PushArg type will expand to a type where CHECK us unable to be compiled.

Required Associated Types§

Source

type OneMore<T: Clone>: VarArgs

The type that is produced by a call to append()

Required Methods§

Source

fn append<T: Clone>(self, val: T) -> Self::OneMore<T>

Append an additional argument to this argument list.

Source

unsafe fn call_printf( self, format_str: *const c_uchar, log_level_str: *const c_uchar, ) -> c_int

Calls printf with the arguments in self and the given format and log level string.

§Safety

Calls into libc printf without any input validation. The code further up the stack is responsible for initializing valid VarArgs that will cause printf to execute in a sound manner.

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 VarArgs for ()

Source§

type OneMore<ARGS0: Clone> = (ARGS0,)

Source§

fn append<ARGS0>(self, val: ARGS0) -> (ARGS0,)

Source§

unsafe fn call_printf( self, format_str: *const c_uchar, log_level_str: *const c_uchar, ) -> c_int

Source§

impl<ARGS0: Clone> VarArgs for (ARGS0,)

Source§

type OneMore<ARGS1: Clone> = (ARGS0, ARGS1)

Source§

fn append<ARGS1>(self, val: ARGS1) -> (ARGS0, ARGS1)

Source§

unsafe fn call_printf( self, format_str: *const c_uchar, log_level_str: *const c_uchar, ) -> c_int

Source§

impl<ARGS0: Clone, ARGS1: Clone> VarArgs for (ARGS0, ARGS1)

Source§

type OneMore<ARGS2: Clone> = (ARGS0, ARGS1, ARGS2)

Source§

fn append<ARGS2>(self, val: ARGS2) -> (ARGS0, ARGS1, ARGS2)

Source§

unsafe fn call_printf( self, format_str: *const c_uchar, log_level_str: *const c_uchar, ) -> c_int

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone> VarArgs for (ARGS0, ARGS1, ARGS2)

Source§

type OneMore<ARGS3: Clone> = (ARGS0, ARGS1, ARGS2, ARGS3)

Source§

fn append<ARGS3>(self, val: ARGS3) -> (ARGS0, ARGS1, ARGS2, ARGS3)

Source§

unsafe fn call_printf( self, format_str: *const c_uchar, log_level_str: *const c_uchar, ) -> c_int

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone, ARGS5: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4, ARGS5)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone, ARGS5: Clone, ARGS6: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4, ARGS5, ARGS6)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone, ARGS5: Clone, ARGS6: Clone, ARGS7: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4, ARGS5, ARGS6, ARGS7)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone, ARGS5: Clone, ARGS6: Clone, ARGS7: Clone, ARGS8: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4, ARGS5, ARGS6, ARGS7, ARGS8)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone, ARGS5: Clone, ARGS6: Clone, ARGS7: Clone, ARGS8: Clone, ARGS9: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4, ARGS5, ARGS6, ARGS7, ARGS8, ARGS9)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone, ARGS5: Clone, ARGS6: Clone, ARGS7: Clone, ARGS8: Clone, ARGS9: Clone, ARGS10: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4, ARGS5, ARGS6, ARGS7, ARGS8, ARGS9, ARGS10)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone, ARGS5: Clone, ARGS6: Clone, ARGS7: Clone, ARGS8: Clone, ARGS9: Clone, ARGS10: Clone, ARGS11: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4, ARGS5, ARGS6, ARGS7, ARGS8, ARGS9, ARGS10, ARGS11)

Source§

impl<ARGS0: Clone, ARGS1: Clone, ARGS2: Clone, ARGS3: Clone, ARGS4: Clone, ARGS5: Clone, ARGS6: Clone, ARGS7: Clone, ARGS8: Clone, ARGS9: Clone, ARGS10: Clone, ARGS11: Clone, ARGS12: Clone> VarArgs for (ARGS0, ARGS1, ARGS2, ARGS3, ARGS4, ARGS5, ARGS6, ARGS7, ARGS8, ARGS9, ARGS10, ARGS11, ARGS12)

Source§

type OneMore<T: Clone> = TooMany

Source§

fn append<T: Clone>(self, _: T) -> TooMany

Source§

unsafe fn call_printf( self, format_str: *const c_uchar, log_level_str: *const c_uchar, ) -> c_int

Implementors§