[][src]Struct qt_core::QCborArray

#[repr(C)]
pub struct QCborArray { /* fields omitted */ }

The QCborArray class is used to hold an array of CBOR elements.

C++ class: QCborArray.

C++ documentation:

The QCborArray class is used to hold an array of CBOR elements.

This class can be used to hold one sequential container in CBOR (an array). CBOR is the Concise Binary Object Representation, a very compact form of binary data encoding that is a superset of JSON. It was created by the IETF Constrained RESTful Environments (CoRE) WG, which has used it in many new RFCs. It is meant to be used alongside the CoAP protocol.

QCborArray is very similar to QVariantList and QJsonArray and its API is almost identical to those two classes. It can also be converted to and from those two, though there may be loss of information in some conversions.

Methods

impl QCborArray[src]

pub unsafe fn append(&mut self, value: impl CastInto<Ref<QCborValue>>)[src]

Calls C++ function: void QCborArray::append(const QCborValue& value).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn at(&self, i: c_longlong) -> CppBox<QCborValue>[src]

Returns the QCborValue element at position i in the array.

Calls C++ function: QCborValue QCborArray::at(long long i) const.

C++ documentation:

Returns the QCborValue element at position i in the array.

If the array is smaller than i elements, this function returns a QCborValue containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the array is not large enough from the case where the array starts with an undefined value.

See also operator[](), first(), last(), insert(), prepend(), append(), removeAt(), and takeAt().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn begin_mut(&mut self) -> CppBox<Iterator>[src]

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

Calls C++ function: QCborArray::Iterator QCborArray::begin().

C++ documentation:

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

See also constBegin() and end().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn begin(&self) -> CppBox<ConstIterator>[src]

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

Calls C++ function: QCborArray::ConstIterator QCborArray::begin() const.

C++ documentation:

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

See also constBegin() and constEnd().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn cbegin(&self) -> CppBox<ConstIterator>[src]

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

Calls C++ function: QCborArray::ConstIterator QCborArray::cbegin() const.

C++ documentation:

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

See also constBegin() and constEnd().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn cend(&self) -> CppBox<ConstIterator>[src]

Returns an array iterator pointing to just after the last element in this array.

Calls C++ function: QCborArray::ConstIterator QCborArray::cend() const.

C++ documentation:

Returns an array iterator pointing to just after the last element in this array.

See also constBegin() and constEnd().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn clear(&mut self)[src]

Empties this array.

Calls C++ function: void QCborArray::clear().

C++ documentation:

Empties this array.

See also isEmpty().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn compare(&self, other: impl CastInto<Ref<QCborArray>>) -> c_int[src]

Compares this array and other, comparing each element in sequence, and returns an integer that indicates whether this array should be sorted before (if the result is negative) or after other (if the result is positive). If this function returns 0, the two arrays are equal and contain the same elements.

Calls C++ function: int QCborArray::compare(const QCborArray& other) const.

C++ documentation:

Compares this array and other, comparing each element in sequence, and returns an integer that indicates whether this array should be sorted before (if the result is negative) or after other (if the result is positive). If this function returns 0, the two arrays are equal and contain the same elements.

For more information on CBOR sorting order, see QCborValue::compare().

See also QCborValue::compare(), QCborMap::compare(), and operator==().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn const_begin(&self) -> CppBox<ConstIterator>[src]

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

Calls C++ function: QCborArray::ConstIterator QCborArray::constBegin() const.

C++ documentation:

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

See also begin() and constEnd().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn const_end(&self) -> CppBox<ConstIterator>[src]

Returns an array iterator pointing to just after the last element in this array.

Calls C++ function: QCborArray::ConstIterator QCborArray::constEnd() const.

C++ documentation:

Returns an array iterator pointing to just after the last element in this array.

See also constBegin() and end().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn contains(&self, value: impl CastInto<Ref<QCborValue>>) -> bool[src]

Returns true if this array contains an element that is equal to value.

Calls C++ function: bool QCborArray::contains(const QCborValue& value) const.

C++ documentation:

Returns true if this array contains an element that is equal to value.

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn copy_from(
    &mut self,
    other: impl CastInto<Ref<QCborArray>>
) -> MutRef<QCborArray>
[src]

Replaces the contents of this array with that found in other, then returns a reference to this object.

Calls C++ function: QCborArray& QCborArray::operator=(const QCborArray& other).

C++ documentation:

Replaces the contents of this array with that found in other, then returns a reference to this object.

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn empty(&self) -> bool[src]

Synonym for isEmpty(). This function is provided for compatibility with generic code that uses the Standard Library API.

Calls C++ function: bool QCborArray::empty() const.

C++ documentation:

Synonym for isEmpty(). This function is provided for compatibility with generic code that uses the Standard Library API.

Returns true if this array is empty (size() == 0).

See also isEmpty() and size().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn end_mut(&mut self) -> CppBox<Iterator>[src]

Returns an array iterator pointing to just after the last element in this array.

Calls C++ function: QCborArray::Iterator QCborArray::end().

C++ documentation:

Returns an array iterator pointing to just after the last element in this array.

See also begin() and constEnd().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn end(&self) -> CppBox<ConstIterator>[src]

Returns an array iterator pointing to just after the last element in this array.

Calls C++ function: QCborArray::ConstIterator QCborArray::end() const.

C++ documentation:

Returns an array iterator pointing to just after the last element in this array.

See also constBegin() and constEnd().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn erase_iterator(
    &mut self,
    it: impl CastInto<Ref<Iterator>>
) -> CppBox<Iterator>
[src]

Calls C++ function: QCborArray::Iterator QCborArray::erase(QCborArray::Iterator it).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn erase_const_iterator(
    &mut self,
    it: impl CastInto<Ref<ConstIterator>>
) -> CppBox<Iterator>
[src]

Calls C++ function: QCborArray::Iterator QCborArray::erase(QCborArray::ConstIterator it).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn extract_const_iterator(
    &mut self,
    it: impl CastInto<Ref<ConstIterator>>
) -> CppBox<QCborValue>
[src]

Calls C++ function: QCborValue QCborArray::extract(QCborArray::ConstIterator it).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn extract_iterator(
    &mut self,
    it: impl CastInto<Ref<Iterator>>
) -> CppBox<QCborValue>
[src]

Calls C++ function: QCborValue QCborArray::extract(QCborArray::Iterator it).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn first(&self) -> CppBox<QCborValue>[src]

Returns the first QCborValue of this array.

Calls C++ function: QCborValue QCborArray::first() const.

C++ documentation:

Returns the first QCborValue of this array.

If the array is empty, this function returns a QCborValue containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the array is not large enough from the case where the array ends with an undefined value.

See also operator[](), at(), last(), insert(), prepend(), append(), removeAt(), and takeAt().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn first_mut(&mut self) -> CppBox<QCborValueRef>[src]

Returns a reference to the first QCborValue of this array. The array must not be empty.

Calls C++ function: QCborValueRef QCborArray::first().

C++ documentation:

Returns a reference to the first QCborValue of this array. The array must not be empty.

QCborValueRef has the exact same API as QCborValue, with one important difference: if you assign new values to it, this map will be updated with that new value.

See also operator[](), at(), last(), insert(), prepend(), append(), removeAt(), and takeAt().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn from_json_array(
    array: impl CastInto<Ref<QJsonArray>>
) -> CppBox<QCborArray>
[src]

Converts all JSON items found in the array array to CBOR using QCborValue::fromJson(), and returns the CBOR array composed of those elements.

Calls C++ function: static QCborArray QCborArray::fromJsonArray(const QJsonArray& array).

C++ documentation:

Converts all JSON items found in the array array to CBOR using QCborValue::fromJson(), and returns the CBOR array composed of those elements.

This conversion is lossless, as the CBOR type system is a superset of JSON's. Moreover, the array returned by this function can be converted back to the original array by using toJsonArray().

See also toJsonArray(), toVariantList(), QCborValue::fromJsonValue(), and QCborMap::fromJsonObject().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn from_string_list(
    list: impl CastInto<Ref<QStringList>>
) -> CppBox<QCborArray>
[src]

Returns a QCborArray containing all the strings found in the list list.

Calls C++ function: static QCborArray QCborArray::fromStringList(const QStringList& list).

C++ documentation:

Returns a QCborArray containing all the strings found in the list list.

See also fromVariantList() and fromJsonArray().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn from_variant_list(
    list: impl CastInto<Ref<QListOfQVariant>>
) -> CppBox<QCborArray>
[src]

Converts all the items in the list to CBOR using QCborValue::fromVariant() and returns the array composed of those elements.

Calls C++ function: static QCborArray QCborArray::fromVariantList(const QList<QVariant>& list).

C++ documentation:

Converts all the items in the list to CBOR using QCborValue::fromVariant() and returns the array composed of those elements.

Conversion from QVariant is not completely lossless. Please see the documentation in QCborValue::fromVariant() for more information.

See also toVariantList(), fromStringList(), fromJsonArray(), and QCborMap::fromVariantMap().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn index(&self, i: c_longlong) -> CppBox<QCborValue>[src]

Returns the QCborValue element at position i in the array.

Calls C++ function: QCborValue QCborArray::operator[](long long i) const.

C++ documentation:

Returns the QCborValue element at position i in the array.

If the array is smaller than i elements, this function returns a QCborValue containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the array is not large enough from the case where the array contains an undefined value at position i.

See also at(), first(), last(), insert(), prepend(), append(), removeAt(), and takeAt().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn index_mut(&mut self, i: c_longlong) -> CppBox<QCborValueRef>[src]

Returns a reference to the QCborValue element at position i in the array. Indices beyond the end of the array will grow the array, filling with undefined entries, until it has an entry at the specified index.

Calls C++ function: QCborValueRef QCborArray::operator[](long long i).

C++ documentation:

Returns a reference to the QCborValue element at position i in the array. Indices beyond the end of the array will grow the array, filling with undefined entries, until it has an entry at the specified index.

QCborValueRef has the exact same API as QCborValue, with one important difference: if you assign new values to it, this map will be updated with that new value.

See also at(), first(), last(), insert(), prepend(), append(), removeAt(), and takeAt().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn insert_longlong_q_cbor_value(
    &mut self,
    i: c_longlong,
    value: impl CastInto<Ref<QCborValue>>
)
[src]

Calls C++ function: void QCborArray::insert(long long i, const QCborValue& value).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn insert_iterator_q_cbor_value(
    &mut self,
    before: impl CastInto<Ref<Iterator>>,
    value: impl CastInto<Ref<QCborValue>>
) -> CppBox<Iterator>
[src]

Calls C++ function: QCborArray::Iterator QCborArray::insert(QCborArray::Iterator before, const QCborValue& value).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn insert_const_iterator_q_cbor_value(
    &mut self,
    before: impl CastInto<Ref<ConstIterator>>,
    value: impl CastInto<Ref<QCborValue>>
) -> CppBox<Iterator>
[src]

Calls C++ function: QCborArray::Iterator QCborArray::insert(QCborArray::ConstIterator before, const QCborValue& value).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn is_empty(&self) -> bool[src]

Returns true if this QCborArray is empty (that is if size() is 0).

Calls C++ function: bool QCborArray::isEmpty() const.

C++ documentation:

Returns true if this QCborArray is empty (that is if size() is 0).

See also size() and clear().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn last(&self) -> CppBox<QCborValue>[src]

Returns the last QCborValue of this array.

Calls C++ function: QCborValue QCborArray::last() const.

C++ documentation:

Returns the last QCborValue of this array.

If the array is empty, this function returns a QCborValue containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the array is not large enough from the case where the array ends with an undefined value.

See also operator[](), at(), first(), insert(), prepend(), append(), removeAt(), and takeAt().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn last_mut(&mut self) -> CppBox<QCborValueRef>[src]

Returns a reference to the last QCborValue of this array. The array must not be empty.

Calls C++ function: QCborValueRef QCborArray::last().

C++ documentation:

Returns a reference to the last QCborValue of this array. The array must not be empty.

QCborValueRef has the exact same API as QCborValue, with one important difference: if you assign new values to it, this map will be updated with that new value.

See also operator[](), at(), first(), insert(), prepend(), append(), removeAt(), and takeAt().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn new() -> CppBox<QCborArray>[src]

Constructs an empty QCborArray.

Calls C++ function: [constructor] void QCborArray::QCborArray().

C++ documentation:

Constructs an empty QCborArray.

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QCborArray>>
) -> CppBox<QCborArray>
[src]

Copies the contents of other into this object.

Calls C++ function: [constructor] void QCborArray::QCborArray(const QCborArray& other).

C++ documentation:

Copies the contents of other into this object.

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn pop_back(&mut self)[src]

Synonym for removeLast(). This function is provided for compatibility with generic code that uses the Standard Library API.

Calls C++ function: void QCborArray::pop_back().

C++ documentation:

Synonym for removeLast(). This function is provided for compatibility with generic code that uses the Standard Library API.

Removes the last element of this array. The array must not be empty before the removal

See also removeLast(), takeLast(), pop_front(), push_back(), append(), and insert().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn pop_front(&mut self)[src]

Synonym for removeFirst(). This function is provided for compatibility with generic code that uses the Standard Library API.

Calls C++ function: void QCborArray::pop_front().

C++ documentation:

Synonym for removeFirst(). This function is provided for compatibility with generic code that uses the Standard Library API.

Removes the first element of this array. The array must not be empty before the removal

See also removeFirst(), takeFirst(), pop_back(), push_front(), prepend(), and insert().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn prepend(&mut self, value: impl CastInto<Ref<QCborValue>>)[src]

Calls C++ function: void QCborArray::prepend(const QCborValue& value).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn push_back(&mut self, t: impl CastInto<Ref<QCborValue>>)[src]

Synonym for append(). This function is provided for compatibility with generic code that uses the Standard Library API.

Calls C++ function: void QCborArray::push_back(const QCborValue& t).

C++ documentation:

Synonym for append(). This function is provided for compatibility with generic code that uses the Standard Library API.

Appends the element t to this array.

See also append(), push_front(), pop_back(), prepend(), and insert().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn push_front(&mut self, t: impl CastInto<Ref<QCborValue>>)[src]

Synonym for prepend(). This function is provided for compatibility with generic code that uses the Standard Library API.

Calls C++ function: void QCborArray::push_front(const QCborValue& t).

C++ documentation:

Synonym for prepend(). This function is provided for compatibility with generic code that uses the Standard Library API.

Prepends the element t to this array.

See also prepend(), push_back(), pop_front(), append(), and insert().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn remove_at(&mut self, i: c_longlong)[src]

Removes the item at position i from the array. The array must have more than i elements before the removal.

Calls C++ function: void QCborArray::removeAt(long long i).

C++ documentation:

Removes the item at position i from the array. The array must have more than i elements before the removal.

See also takeAt(), removeFirst(), removeLast(), at(), operator[](), insert(), prepend(), and append().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn remove_first(&mut self)[src]

Removes the first item in the array, making the second element become the first. The array must not be empty before this call.

Calls C++ function: void QCborArray::removeFirst().

C++ documentation:

Removes the first item in the array, making the second element become the first. The array must not be empty before this call.

See also removeAt(), takeFirst(), removeLast(), at(), operator[](), insert(), prepend(), and append().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn remove_last(&mut self)[src]

Removes the last item in the array. The array must not be empty before this call.

Calls C++ function: void QCborArray::removeLast().

C++ documentation:

Removes the last item in the array. The array must not be empty before this call.

See also removeAt(), takeLast(), removeFirst(), at(), operator[](), insert(), prepend(), and append().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn size(&self) -> c_longlong[src]

Returns the size of this array.

Calls C++ function: long long QCborArray::size() const.

C++ documentation:

Returns the size of this array.

See also isEmpty().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn swap(&mut self, other: impl CastInto<MutRef<QCborArray>>)[src]

Swaps the contents of this object and other.

Calls C++ function: void QCborArray::swap(QCborArray& other).

C++ documentation:

Swaps the contents of this object and other.

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn take_at(&mut self, i: c_longlong) -> CppBox<QCborValue>[src]

Removes the item at position i from the array and returns it. The array must have more than i elements before the removal.

Calls C++ function: QCborValue QCborArray::takeAt(long long i).

C++ documentation:

Removes the item at position i from the array and returns it. The array must have more than i elements before the removal.

See also removeAt(), removeFirst(), removeLast(), at(), operator[](), insert(), prepend(), and append().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn take_first(&mut self) -> CppBox<QCborValue>[src]

Removes the first item in the array and returns it, making the second element become the first. The array must not be empty before this call.

Calls C++ function: QCborValue QCborArray::takeFirst().

C++ documentation:

Removes the first item in the array and returns it, making the second element become the first. The array must not be empty before this call.

See also takeAt(), removeFirst(), removeLast(), at(), operator[](), insert(), prepend(), and append().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn take_last(&mut self) -> CppBox<QCborValue>[src]

Removes the last item in the array and returns it. The array must not be empty before this call.

Calls C++ function: QCborValue QCborArray::takeLast().

C++ documentation:

Removes the last item in the array and returns it. The array must not be empty before this call.

See also takeAt(), removeLast(), removeFirst(), at(), operator[](), insert(), prepend(), and append().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn to_cbor_value(&self) -> CppBox<QCborValue>[src]

Explicitly construcuts a QCborValue object that represents this array. This function is usually not necessary since QCborValue has a constructor for QCborArray, so the conversion is implicit.

Calls C++ function: QCborValue QCborArray::toCborValue() const.

C++ documentation:

Explicitly construcuts a QCborValue object that represents this array. This function is usually not necessary since QCborValue has a constructor for QCborArray, so the conversion is implicit.

Converting QCborArray to QCborValue allows it to be used in any context where QCborValues can be used, including as items in QCborArrays and as keys and mapped types in QCborMap. Converting an array to QCborValue allows access to QCborValue::toCbor().

See also QCborValue::QCborValue(const QCborArray &).

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn to_json_array(&self) -> CppBox<QJsonArray>[src]

Recursively converts every QCborValue element in this array to JSON using QCborValue::toJsonValue() and returns the corresponding QJsonArray composed of those elements.

Calls C++ function: QJsonArray QCborArray::toJsonArray() const.

C++ documentation:

Recursively converts every QCborValue element in this array to JSON using QCborValue::toJsonValue() and returns the corresponding QJsonArray composed of those elements.

Please note that CBOR contains a richer and wider type set than JSON, so some information may be lost in this conversion. For more details on what conversions are applied, see QCborValue::toJsonValue().

See also fromJsonArray(), QCborValue::toJsonValue(), QCborMap::toJsonObject(), and toVariantList().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn to_variant_list(&self) -> CppBox<QListOfQVariant>[src]

Recursively converts each QCborValue in this array using QCborValue::toVariant() and returns the QVariantList composed of the converted items.

Calls C++ function: QList<QVariant> QCborArray::toVariantList() const.

C++ documentation:

Recursively converts each QCborValue in this array using QCborValue::toVariant() and returns the QVariantList composed of the converted items.

Conversion to QVariant is not completely lossless. Please see the documentation in QCborValue::toVariant() for more information.

See also fromVariantList(), fromStringList(), toJsonArray(), QCborValue::toVariant(), and QCborMap::toVariantMap().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

Trait Implementations

impl<'_> Add<Ref<QCborValue>> for &'_ QCborArray[src]

type Output = CppBox<QCborArray>

The resulting type after applying the + operator.

fn add(self, v: Ref<QCborValue>) -> CppBox<QCborArray>[src]

Returns a new QCborArray containing the same elements as this array, plus v appended as the last element.

Calls C++ function: QCborArray QCborArray::operator+(const QCborValue& v) const.

C++ documentation:

Returns a new QCborArray containing the same elements as this array, plus v appended as the last element.

See also operator+=(), operator<<(), and append().

impl AddAssign<Ref<QCborValue>> for QCborArray[src]

fn add_assign(&mut self, v: Ref<QCborValue>)[src]

Appends v to this array and returns a reference to this array.

Calls C++ function: QCborArray& QCborArray::operator+=(const QCborValue& v).

C++ documentation:

Appends v to this array and returns a reference to this array.

See also append(), insert(), operator+(), and operator<<().

impl Begin for QCborArray[src]

type Output = CppBox<ConstIterator>

Output type.

unsafe fn begin(&self) -> CppBox<ConstIterator>[src]

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

Calls C++ function: QCborArray::ConstIterator QCborArray::begin() const.

C++ documentation:

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

See also constBegin() and constEnd().

impl BeginMut for QCborArray[src]

type Output = CppBox<Iterator>

Output type.

unsafe fn begin_mut(&mut self) -> CppBox<Iterator>[src]

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

Calls C++ function: QCborArray::Iterator QCborArray::begin().

C++ documentation:

Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().

See also constBegin() and end().

impl CppDeletable for QCborArray[src]

unsafe fn delete(&mut self)[src]

Destroys this QCborArray and frees any associated resources.

Calls C++ function: [destructor] void QCborArray::~QCborArray().

C++ documentation:

Destroys this QCborArray and frees any associated resources.

impl End for QCborArray[src]

type Output = CppBox<ConstIterator>

Output type.

unsafe fn end(&self) -> CppBox<ConstIterator>[src]

Returns an array iterator pointing to just after the last element in this array.

Calls C++ function: QCborArray::ConstIterator QCborArray::end() const.

C++ documentation:

Returns an array iterator pointing to just after the last element in this array.

See also constBegin() and constEnd().

impl EndMut for QCborArray[src]

type Output = CppBox<Iterator>

Output type.

unsafe fn end_mut(&mut self) -> CppBox<Iterator>[src]

Returns an array iterator pointing to just after the last element in this array.

Calls C++ function: QCborArray::Iterator QCborArray::end().

C++ documentation:

Returns an array iterator pointing to just after the last element in this array.

See also begin() and constEnd().

impl Lt<Ref<QCborArray>> for QCborArray[src]

unsafe fn lt(&self, other: &Ref<QCborArray>) -> bool[src]

Compares this array and other, comparing each element in sequence, and returns true if this array should be sorted before other, false otherwise.

Calls C++ function: bool QCborArray::operator<(const QCborArray& other) const.

C++ documentation:

Compares this array and other, comparing each element in sequence, and returns true if this array should be sorted before other, false otherwise.

For more information on CBOR sorting order, see QCborValue::compare().

See also compare(), QCborValue::operator==(), QCborMap::operator==(), operator==(), and operator!=().

impl PartialEq<Ref<QCborArray>> for QCborArray[src]

fn eq(&self, other: &Ref<QCborArray>) -> bool[src]

Compares this array and other, comparing each element in sequence, and returns true if both arrays contains the same elements, false otherwise.

Calls C++ function: bool QCborArray::operator==(const QCborArray& other) const.

C++ documentation:

Compares this array and other, comparing each element in sequence, and returns true if both arrays contains the same elements, false otherwise.

For more information on CBOR equality in Qt, see, QCborValue::compare().

See also compare(), QCborValue::operator==(), QCborMap::operator==(), operator!=(), and operator<().

impl<'_> Shl<Ref<QCborValue>> for &'_ QCborArray[src]

type Output = MutRef<QCborArray>

The resulting type after applying the << operator.

fn shl(self, v: Ref<QCborValue>) -> MutRef<QCborArray>[src]

Appends v to this array and returns a reference to this array.

Calls C++ function: QCborArray& QCborArray::operator<<(const QCborValue& v).

C++ documentation:

Appends v to this array and returns a reference to this array.

See also append(), insert(), operator+(), and operator+=().

impl Size for QCborArray[src]

unsafe fn size(&self) -> usize[src]

Returns the size of this array.

Calls C++ function: long long QCborArray::size() const.

C++ documentation:

Returns the size of this array.

See also isEmpty().

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.