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

A collection of C-compatible (NUL-terminated) string pairs that is useful with C APIs that require an array of string pair pointers, normally specified as const* MQTTAsync_nameValue

Implementations

Creates a NameValueCollection from a vector of string pair references.

Arguments

coll A collection of string pair 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 pair pointers.

This returns a pointer that can be sent to a C API that takes a pointer to an array of name/value char pointer pairs, like const MQTTAsync_nameValue*

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.

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

Converts to this type from the input type.

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.