Module std::str::raw

Unsafe operations

Functions

as_owned_vec

Access the str in its vector representation. The caller must preserve the valid UTF-8 property when modifying.

c_str_to_static_slice

Form a slice from a C string. Unsafe because the caller must ensure the C string has the static lifetime, or else the return value may be invalidated later.

from_buf_len

Create a Rust string from a *u8 buffer of the given length

from_byte

Converts a byte to a string.

from_c_multistring

Parses a C "multistring", eg windows env values or the req->ptr result in a uv_fs_readdir() call. Optionally, a count can be passed in, limiting the parsing to only being done count-times.

from_c_str

Create a Rust string from a null-terminated C string

from_utf8

Converts a vector of bytes to a new owned string.

from_utf8_owned

Converts an owned vector of bytes to a new owned string. This assumes that the utf-8-ness of the vector has already been validated

pop_byte

Removes the last byte from a string and returns it. The caller must preserve the valid UTF-8 property.

push_byte

Appends a byte to a string. The caller must preserve the valid UTF-8 property.

push_bytes

Appends a vector of bytes to a string. The caller must preserve the valid UTF-8 property.

set_len

Sets the length of a string

shift_byte

Removes the first byte from a string and returns it. The caller must preserve the valid UTF-8 property.

slice_bytes

Takes a bytewise (not UTF-8) slice from a string.

slice_unchecked

Takes a bytewise (not UTF-8) slice from a string.

strdup_uniq