Struct lrs::string::NoNullString

An owned byte slice with no null bytes.

Syntax

struct NoNullString<Heap = Libc>
    where Heap: Allocator,
{
    /* private fields */
}

Static methods

NameDescription
buffered

Creates a NoNullString that is backed by borrowed memory.

from_bytes
from_bytes_unchecked

Creates a NoNullString by wrapping a vector without checking it for validity.

new

Creates a new, allocated NoNullString.

Methods

ReceiverNameDescription
&mut selfclear

Truncates the string to length 0.

&mut selfpop_file

Removes the file-part of the string, returning a reference to it.

&mut selfpush_file

Appends a filename to the string.

&mut selfreserve

Reserves memory for new bytes in the string.

&mut selfset_len

Truncates the string to a certain size that can be greater than the current size.

&mut selfset_path

Clears the string and sets it to a new value.

&mut selftruncate

Truncates the string to a certain size.

&mut selfunused

Returns a slice to the unused but reserved memory in the underlying vector.

Trait implementations

NameDescription
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 (9 times)

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

UndefState

Types that are not valid when they contain certain bit patterns.