Trait printf_wrap::PrintfArgument
source · [−]pub trait PrintfArgument: PrintfArgumentPrivate + Copy {
type CPrintfType;
Show 12 associated constants and 1 method
const IS_CHAR: bool = false;
const IS_SHORT: bool = false;
const IS_INT: bool = false;
const IS_LONG: bool = false;
const IS_LONG_LONG: bool = false;
const IS_SIZE: bool = false;
const IS_MAX: bool = false;
const IS_PTRDIFF: bool = false;
const IS_SIGNED: bool = false;
const IS_FLOAT: bool = false;
const IS_C_STRING: bool = false;
const IS_POINTER: bool = false;
fn as_c_val(self) -> Self::CPrintfType;
}Expand description
A Rust-side argument to a safe wrapper around a printf(3)-like function.
This is a sealed trait; consumers of this crate are not allowed
to create their own impls in order to unconditionally preserve
safety.
Required Associated Types
sourcetype CPrintfType
type CPrintfType
The C type corresponding to Self that we should really send
as an argument to a printf(3)-like function.
Provided Associated Constants
sourceconst IS_LONG_LONG: bool = false
const IS_LONG_LONG: bool = false
Whether the type is consistent with C’s long long int.
Available on crate feature
libc only.Whether the type is consistent with C’s size_t.
Available on crate feature
libc only.Whether the type is consistent with C’s intmax_t.
sourceconst IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Available on crate feature
libc only.Whether the type is consistent with C’s ptrdiff_t.
Whether the type is a signed integer type, as opposed to unsigned.
sourceconst IS_C_STRING: bool = false
const IS_C_STRING: bool = false
Whether the type is a null-terminated string.
sourceconst IS_POINTER: bool = false
const IS_POINTER: bool = false
Whether the type is a pointer.
Required Methods
sourcefn as_c_val(self) -> Self::CPrintfType
fn as_c_val(self) -> Self::CPrintfType
Converts self to a value suitable for sending to printf(3).
Implementations on Foreign Types
sourceimpl PrintfArgument for u8
impl PrintfArgument for u8
const IS_SIGNED: bool = false
const IS_CHAR: bool = true
const IS_SHORT: bool = false
const IS_INT: bool = false
const IS_LONG: bool = false
const IS_LONG_LONG: bool = false
sourceconst IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Available on crate feature
libc only.type CPrintfType = <u8 as LargerOfOp<u32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for i8
impl PrintfArgument for i8
const IS_SIGNED: bool = true
const IS_CHAR: bool = true
const IS_SHORT: bool = false
const IS_INT: bool = false
const IS_LONG: bool = false
const IS_LONG_LONG: bool = false
sourceconst IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Available on crate feature
libc only.type CPrintfType = <i8 as LargerOfOp<i32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for u16
impl PrintfArgument for u16
const IS_SIGNED: bool = false
const IS_CHAR: bool = false
const IS_SHORT: bool = true
const IS_INT: bool = false
const IS_LONG: bool = false
const IS_LONG_LONG: bool = false
sourceconst IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Available on crate feature
libc only.type CPrintfType = <u16 as LargerOfOp<u32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for i16
impl PrintfArgument for i16
const IS_SIGNED: bool = true
const IS_CHAR: bool = false
const IS_SHORT: bool = true
const IS_INT: bool = false
const IS_LONG: bool = false
const IS_LONG_LONG: bool = false
sourceconst IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Available on crate feature
libc only.type CPrintfType = <i16 as LargerOfOp<i32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for u32
impl PrintfArgument for u32
const IS_SIGNED: bool = false
const IS_CHAR: bool = false
const IS_SHORT: bool = false
const IS_INT: bool = true
const IS_LONG: bool = false
const IS_LONG_LONG: bool = false
sourceconst IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Available on crate feature
libc only.type CPrintfType = <u32 as LargerOfOp<u32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for i32
impl PrintfArgument for i32
const IS_SIGNED: bool = true
const IS_CHAR: bool = false
const IS_SHORT: bool = false
const IS_INT: bool = true
const IS_LONG: bool = false
const IS_LONG_LONG: bool = false
sourceconst IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Available on crate feature
libc only.type CPrintfType = <i32 as LargerOfOp<i32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for u64
impl PrintfArgument for u64
const IS_SIGNED: bool = false
const IS_CHAR: bool = false
const IS_SHORT: bool = false
const IS_INT: bool = false
const IS_LONG: bool = true
const IS_LONG_LONG: bool = true
sourceconst IS_PTRDIFF: bool = true
const IS_PTRDIFF: bool = true
Available on crate feature
libc only.type CPrintfType = <u64 as LargerOfOp<u32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for i64
impl PrintfArgument for i64
const IS_SIGNED: bool = true
const IS_CHAR: bool = false
const IS_SHORT: bool = false
const IS_INT: bool = false
const IS_LONG: bool = true
const IS_LONG_LONG: bool = true
sourceconst IS_PTRDIFF: bool = true
const IS_PTRDIFF: bool = true
Available on crate feature
libc only.type CPrintfType = <i64 as LargerOfOp<i32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for usize
impl PrintfArgument for usize
const IS_SIGNED: bool = false
const IS_CHAR: bool = false
const IS_SHORT: bool = false
const IS_INT: bool = false
const IS_LONG: bool = true
const IS_LONG_LONG: bool = true
sourceconst IS_PTRDIFF: bool = true
const IS_PTRDIFF: bool = true
Available on crate feature
libc only.type CPrintfType = <usize as LargerOfOp<u32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for isize
impl PrintfArgument for isize
const IS_SIGNED: bool = true
const IS_CHAR: bool = false
const IS_SHORT: bool = false
const IS_INT: bool = false
const IS_LONG: bool = true
const IS_LONG_LONG: bool = true
sourceconst IS_PTRDIFF: bool = true
const IS_PTRDIFF: bool = true
Available on crate feature
libc only.