Struct paho_mqtt::name_value::NameValueCollection
source · 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§
source§impl NameValueCollection
impl NameValueCollection
sourcepub fn new<N, V>(coll: &[(N, V)]) -> Self
pub fn new<N, V>(coll: &[(N, V)]) -> Self
Creates a NameValueCollection from a vector of string pair references.
§Arguments
coll
A collection of string pair references.
sourcepub fn as_c_arr_ptr(&self) -> *const MQTTAsync_nameValue
pub fn as_c_arr_ptr(&self) -> *const MQTTAsync_nameValue
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§
source§impl Clone for NameValueCollection
impl Clone for NameValueCollection
source§impl Debug for NameValueCollection
impl Debug for NameValueCollection
source§impl Default for NameValueCollection
impl Default for NameValueCollection
Auto Trait Implementations§
impl Freeze for NameValueCollection
impl RefUnwindSafe for NameValueCollection
impl !Send for NameValueCollection
impl !Sync for NameValueCollection
impl Unpin for NameValueCollection
impl UnwindSafe for NameValueCollection
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more