pub struct StringCollection { /* private fields */ }
Expand description

A collection of C-compatible (NUL-terminated) strings that is useful with C API’s that require an array of strings, normally specified as: const char* arr[] or const char** arr

Implementations

Creates a StringCollection from a vector of string references.

Arguments

coll A collection of string references.

Returns true if the collection contains elements.

Gets the number of strings in the collection.

Gets the collection as a pointer to const C string pointers.

This returns a pointer that can be sent to a C API that takes a pointer to an array of char pointers, like const char* arr[] This function is inherently unsafe. The pointer it returns is only valid while the collection remains unmodified. In general, it should be requested when needed and not stored for future use.

Gets the collection as a pointer to mutable C string pointers.

This returns a pointer that can be sent to a C API that takes a pointer to an array of mutable char pointers, like char* arr[] This function is inherently unsafe. The pointer it returns is only valid while the collection remains unmodified. In general, it should be requested when needed and not stored for future use.

This function is required due to the lax nature of the use of const strings in the C API. Hopefully the API will be fixed and this function can be removed

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

Returns the “default value” for a type. Read more

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 resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.