Struct printf_wrap::NullString
source · [−]pub struct NullString { /* private fields */ }Expand description
A wrapper for a 'static null-terminated string.
Sometimes used in favor of std’s
CStr or CString types,
as NullStrings can be made as compile-time constants.
Implementations
sourceimpl NullString
impl NullString
sourcepub const fn new(s: &'static str) -> NullString
pub const fn new(s: &'static str) -> NullString
Creates a NullString from s
or panics if s is not null-terminated.
Panics
Panics if the string s does not end in the null character.
Trait Implementations
sourceimpl Clone for NullString
impl Clone for NullString
sourcefn clone(&self) -> NullString
fn clone(&self) -> NullString
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for NullString
impl Debug for NullString
sourceimpl From<&'static CStr> for NullString
Available on crate feature std only.
impl From<&'static CStr> for NullString
std only.sourceimpl From<NullString> for &'static CStr
Available on crate feature std only.
impl From<NullString> for &'static CStr
std only.sourcefn from(nstr: NullString) -> Self
fn from(nstr: NullString) -> Self
Converts to this type from the input type.
sourceimpl PrintfArgument for NullString
impl PrintfArgument for NullString
type CPrintfType = *const i8
type CPrintfType = *const i8
The C type corresponding to Self that we should really send
as an argument to a printf(3)-like function. Read more
sourceconst IS_C_STRING: bool = true
const IS_C_STRING: bool = true
Whether the type is a null-terminated string.
sourceconst IS_LONG_LONG: bool = false
const IS_LONG_LONG: bool = false
Whether the type is consistent with C’s long long int.
sourceconst IS_PTRDIFF: bool = false
const IS_PTRDIFF: bool = false
Whether the type is consistent with C’s ptrdiff_t.
sourceconst IS_SIGNED: bool = false
const IS_SIGNED: bool = false
Whether the type is a signed integer type, as opposed to unsigned.
sourceconst IS_POINTER: bool = false
const IS_POINTER: bool = false
Whether the type is a pointer.
impl Copy for NullString
Auto Trait Implementations
impl RefUnwindSafe for NullString
impl !Send for NullString
impl !Sync for NullString
impl Unpin for NullString
impl UnwindSafe for NullString
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> PrintfArgs for T where
T: PrintfArgument,
impl<T> PrintfArgs for T where
T: PrintfArgument,
type AsList = (T, ())
type AsList = (T, ())
The PrintfArgsList equivalent to Self.