Struct qt_core::QCborArray

source ·
#[repr(C)]
pub struct QCborArray { /* private fields */ }
Expand description

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.

Implementations§

source§

impl QCborArray

source

pub unsafe fn add_assign( &self, v: impl CastInto<Ref<QCborValue>> ) -> Ref<QCborArray>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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<<().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn begin_mut(&self) -> CppBox<Iterator>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn clear(&self)

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Empties this array.

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

C++ documentation:

Empties this array.

See also isEmpty().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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==().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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.

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QCborArray>> ) -> Ref<QCborArray>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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.

source

pub unsafe fn empty(&self) -> bool

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn end_mut(&self) -> CppBox<Iterator>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn first_mut(&self) -> CppBox<QCborValueRef>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

pub unsafe fn is_empty(&self) -> bool

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn last_mut(&self) -> CppBox<QCborValueRef>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn new() -> CppBox<QCborArray>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Constructs an empty QCborArray.

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

C++ documentation:

Constructs an empty QCborArray.

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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.

source

pub unsafe fn pop_back(&self)

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn pop_front(&self)

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn remove_at(&self, i: c_longlong)

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn remove_first(&self)

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn remove_last(&self)

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn size(&self) -> c_longlong

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<QCborArray>>)

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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.

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn take_first(&self) -> CppBox<QCborValue>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

pub unsafe fn take_last(&self) -> CppBox<QCborValue>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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 &).

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

source

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

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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().

Trait Implementations§

source§

impl Add<Ref<QCborValue>> for &QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

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

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().

§

type Output = CppBox<QCborArray>

The resulting type after applying the + operator.
source§

impl Begin for QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

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

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().

§

type Output = CppBox<ConstIterator>

Output type.
source§

impl BeginMut for QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

unsafe fn begin_mut(&self) -> CppBox<Iterator>

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().

§

type Output = CppBox<Iterator>

Output type.
source§

impl CppDeletable for QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

unsafe fn delete(&self)

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.

source§

impl End for QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

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

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().

§

type Output = CppBox<ConstIterator>

Output type.
source§

impl EndMut for QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

unsafe fn end_mut(&self) -> CppBox<Iterator>

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().

§

type Output = CppBox<Iterator>

Output type.
source§

impl Lt<Ref<QCborArray>> for QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

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

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!=().

source§

impl PartialEq<Ref<QCborArray>> for QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

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

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<().

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Shl<Ref<QCborValue>> for &QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

fn shl(self, v: Ref<QCborValue>) -> Ref<QCborArray>

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+=().

§

type Output = Ref<QCborArray>

The resulting type after applying the << operator.
source§

impl Size for QCborArray

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.
source§

unsafe fn size(&self) -> usize

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.