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
type 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
const IS_LONG_LONG: bool = false
const IS_LONG_LONG: bool = false
Whether the type is consistent with C’s long long int.
const IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Whether the type is consistent with C’s ptrdiff_t.
Whether the type is a signed integer type, as opposed to unsigned.
const IS_C_STRING: bool = false
const IS_C_STRING: bool = false
Whether the type is a null-terminated string.
const IS_POINTER: bool = false
const IS_POINTER: bool = false
Whether the type is a pointer.
Required Methods
fn 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
const IS_SIZE: bool = false
const IS_MAX: bool = false
const IS_PTRDIFF: bool = false
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
const IS_SIZE: bool = false
const IS_MAX: bool = false
const IS_PTRDIFF: bool = false
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
const IS_SIZE: bool = false
const IS_MAX: bool = false
const IS_PTRDIFF: bool = false
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
const IS_SIZE: bool = false
const IS_MAX: bool = false
const IS_PTRDIFF: bool = false
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
const IS_SIZE: bool = false
const IS_MAX: bool = false
const IS_PTRDIFF: bool = false
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
const IS_SIZE: bool = false
const IS_MAX: bool = false
const IS_PTRDIFF: bool = false
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
const IS_SIZE: bool = true
const IS_MAX: bool = true
const IS_PTRDIFF: bool = true
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
const IS_SIZE: bool = true
const IS_MAX: bool = true
const IS_PTRDIFF: bool = true
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
const IS_SIZE: bool = true
const IS_MAX: bool = true
const IS_PTRDIFF: bool = true
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
const IS_SIZE: bool = true
const IS_MAX: bool = true
const IS_PTRDIFF: bool = true
type CPrintfType = <isize as LargerOfOp<i32>>::Output
fn as_c_val(self) -> Self::CPrintfType
sourceimpl PrintfArgument for f32
impl PrintfArgument for f32
sourceimpl PrintfArgument for f64
impl PrintfArgument for f64
sourceimpl PrintfArgument for &CStr
Available on crate feature std only.
impl PrintfArgument for &CStr
Available on crate feature
std only.type CPrintfType = *const i8
const IS_C_STRING: bool = true
fn as_c_val(self) -> *const c_char
sourceimpl PrintfArgument for &CString
Available on crate feature std only.
impl PrintfArgument for &CString
Available on crate feature
std only.