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

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.

Returns a pointer to the beginning of the wrapped string.

Available on crate feature std only.

Returns a &CStr pointing to the wrapped string.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

The C type corresponding to Self that we should really send as an argument to a printf(3)-like function. Read more

Whether the type is a null-terminated string.

Converts self to a value suitable for sending to printf(3).

Whether the type is consistent with C’s char.

Whether the type is consistent with C’s short int.

Whether the type is consistent with C’s int.

Whether the type is consistent with C’s long int.

Whether the type is consistent with C’s long long int.

Whether the type is consistent with C’s size_t.

Whether the type is consistent with C’s intmax_t.

Whether the type is consistent with C’s ptrdiff_t.

Whether the type is a signed integer type, as opposed to unsigned.

Whether the type is floating-point.

Whether the type is a pointer.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The PrintfArgsList equivalent to Self.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.