Struct lrs::string::CStr

A byte slice that has exactly one null byte at the very end.

Syntax

struct CStr {
    /* private fields */
}

Static methods

NameDescription
empty

Returns an empty CStr.

from_bytes_unchecked

Casts a byte slice to a CStr without checking it for validity.

from_mut_bytes_unchecked

Casts a byte slice to a mutable CStr without checking it for validity.

from_ptr

Creates a new CStr from a pointer.

Methods

ReceiverNameDescription
&mut selfas_mut_ptr

Returns a mutable pointer to the first byte in the CStr.

&selfas_ptr

Returns a pointer to the first byte in the CStr.

&selfbytes_with_null

Returns the contained bytes including the null byte.

Trait implementations

NameDescription
AsCStr

Objects that can be interpreted as CStrs.

AsMutCStr

Objects that can be interpreted as mutable CStrs.

AsMutNoNullStr

Objects that can be borrowed as a mutable NoNullStr.

AsNoNullStr

Objects that can be borrowed as a NoNullStr.

Debug

Objects that can be formatted in a "debug" form.

Deref

Objects that implement the immutable dereference operator.

DerefMut

Objects that implement the mutable dereference operator.

Eq

Objects that implement the binary == and != operators.

Index (5 times)

Objects that implement the immutable subscript operator.

IndexMut (4 times)

Objects that implement the mutable subscript operator.

Parse

Types that can be parsed.

ToCStr

Objects that can be transformed into CStrs provided they have some scratch space available.