Struct cxx_qt_lib::QByteArray

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

The QByteArray class provides an array of bytes.

Implementations§

source§

impl QByteArray

source

pub fn clear(&mut self)

Clears the contents of the byte array and makes it null.

source§

impl QByteArray

source

pub fn is_empty(&self) -> bool

Returns true if the byte array has size 0; otherwise returns false.

source§

impl QByteArray

source

pub fn is_lower(&self) -> bool

Returns true if this byte array is lowercase, that is, if it’s identical to its toLower() folding.

source§

impl QByteArray

source

pub fn is_null(&self) -> bool

Returns true if this byte array is null; otherwise returns false.

source§

impl QByteArray

source

pub fn is_upper(&self) -> bool

Returns true if this byte array is uppercase, that is, if it’s identical to its toUpper() folding.

source§

impl QByteArray

source

pub fn squeeze(&mut self)

Releases any memory not required to store the array’s data.

source§

impl QByteArray

source

pub fn append(&mut self, ch: u8)

Inserts value at the end of the list.

source

pub fn as_mut_slice(&mut self) -> &mut [u8]

Construct a mutable slice of u8 from a QByteArray

source

pub fn as_slice(&self) -> &[u8]

Construct a slice of u8 from a QByteArray

source

pub fn fill(&mut self, ch: u8, size: isize)

Sets every byte in the byte array to ch. If size is different from -1 (the default), the byte array is resized to size size beforehand.

source

pub unsafe fn from_raw_data(bytes: &[u8]) -> Self

Construct a QByteArray from a &[u8] without a deep copy

§Safety

The caller must ensure that the original slice outlives the QByteArray and that the QByteArray is not modified

source

pub fn insert(&mut self, pos: isize, ch: u8)

Inserts item value into the list at the given position.

source

pub fn len(&self) -> isize

Returns the number of items in the QByteArray.

source

pub fn remove(&mut self, pos: isize, len: isize)

Removes len bytes from the array, starting at index position pos.

source

pub fn reserve(&mut self, size: isize)

Reserve the specified capacity to prevent repeated allocations when the maximum size is known.

source

pub fn resize(&mut self, size: isize)

Sets the size of the byte array to size bytes.

If size is greater than the current size, the byte array is extended to make it size bytes with the extra bytes added to the end. The new bytes are uninitialized.

If size is less than the current size, bytes beyond position size are excluded from the byte array.

source

pub fn simplified(&self) -> Self

Returns a copy of this byte array that has spacing characters removed from the start and end, and in which each sequence of internal spacing characters is replaced with a single space.

source

pub fn to_lower(&self) -> Self

Returns a copy of the byte array in which each ASCII uppercase letter converted to lowercase.

source

pub fn to_upper(&self) -> Self

Returns a copy of the byte array in which each ASCII lowercase letter converted to uppercase.

source

pub fn trimmed(&self) -> Self

Returns a copy of this byte array with spacing characters removed from the start and end.

Trait Implementations§

source§

impl AsRef<[u8]> for QByteArray

source§

fn as_ref(&self) -> &[u8]

Construct a slice of u8 from a QByteArray

source§

impl Clone for QByteArray

source§

fn clone(&self) -> Self

Constructs a copy of other.

This operation takes constant time, because QByteArray is implicitly shared similar to a std::borrow::Cow. This makes returning a QByteArray from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and that takes linear time.

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QByteArray

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for QByteArray

source§

fn default() -> Self

Constructs an empty byte array.

source§

impl Display for QByteArray

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Convert the QByteArray to a Rust string

source§

impl Drop for QByteArray

source§

fn drop(&mut self)

Destroys the byte array.

source§

impl ExternType for QByteArray

§

type Id = (Q, B, y, t, e, A, r, r, a, y)

A type-level representation of the type’s C++ namespace and type name. Read more
§

type Kind = Trivial

source§

impl From<&[u8]> for QByteArray

source§

fn from(bytes: &[u8]) -> Self

Constructs a QByteArray from a &[u8]. This makes a deep copy of the data.

source§

impl From<&QByteArray> for Vec<u8>

source§

fn from(bytearray: &QByteArray) -> Self

Convert the QByteArray to a Vec<u8>. This makes a deep copy of the data.

source§

impl From<&String> for QByteArray

source§

fn from(str: &String) -> Self

Constructs a QByteArray from a Rust string. This makes a deep copy of the data.

source§

impl From<&str> for QByteArray

source§

fn from(str: &str) -> Self

Constructs a QByteArray from a Rust string slice. This makes a deep copy of the data.

source§

impl PartialEq for QByteArray

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
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 QListElement for QByteArray

§

type TypeId = (Q, L, i, s, t, __, Q, B, y, t, e, A, r, r, a, y)

source§

fn append(list: &mut QList<Self>, value: Self)

source§

fn append_clone(list: &mut QList<Self>, value: &Self)

source§

fn clear(list: &mut QList<Self>)

source§

fn clone(list: &QList<Self>) -> QList<Self>

source§

fn contains(list: &QList<Self>, value: &Self) -> bool

source§

fn default() -> QList<Self>

source§

fn drop(list: &mut QList<Self>)

source§

unsafe fn get_unchecked(list: &QList<Self>, pos: isize) -> &Self

Safety Read more
source§

fn index_of(list: &QList<Self>, value: &Self) -> isize

source§

fn insert(list: &mut QList<Self>, pos: isize, value: Self)

source§

fn insert_clone(list: &mut QList<Self>, pos: isize, value: &Self)

source§

fn len(list: &QList<Self>) -> isize

source§

fn remove(list: &mut QList<Self>, pos: isize)

source§

fn reserve(list: &mut QList<Self>, size: isize)

source§

impl QSetElement for QByteArray

§

type TypeId = (Q, S, e, t, __, Q, B, y, t, e, A, r, r, a, y)

source§

fn clear(set: &mut QSet<Self>)

source§

fn clone(set: &QSet<Self>) -> QSet<Self>

source§

fn contains(set: &QSet<Self>, value: &Self) -> bool

source§

fn default() -> QSet<Self>

source§

fn drop(set: &mut QSet<Self>)

source§

unsafe fn get_unchecked(set: &QSet<Self>, pos: isize) -> &Self

Safety Read more
source§

fn insert(set: &mut QSet<Self>, value: Self)

source§

fn insert_clone(set: &mut QSet<Self>, value: &Self)

source§

fn len(set: &QSet<Self>) -> isize

source§

fn remove(set: &mut QSet<Self>, value: &Self) -> bool

source§

impl QVariantValue for QByteArray

source§

impl QVectorElement for QByteArray

§

type TypeId = (Q, V, e, c, t, o, r, __, Q, B, y, t, e, A, r, r, a, y)

source§

fn append(vector: &mut QVector<Self>, value: Self)

source§

fn append_clone(vector: &mut QVector<Self>, value: &Self)

source§

fn clear(vector: &mut QVector<Self>)

source§

fn clone(vector: &QVector<Self>) -> QVector<Self>

source§

fn contains(vector: &QVector<Self>, value: &Self) -> bool

source§

fn default() -> QVector<Self>

source§

fn drop(vector: &mut QVector<Self>)

source§

unsafe fn get_unchecked(vector: &QVector<Self>, pos: isize) -> &Self

Safety Read more
source§

fn index_of(vector: &QVector<Self>, value: &Self) -> isize

source§

fn insert(vector: &mut QVector<Self>, pos: isize, value: Self)

source§

fn insert_clone(vector: &mut QVector<Self>, pos: isize, value: &Self)

source§

fn len(vector: &QVector<Self>) -> isize

source§

fn remove(vector: &mut QVector<Self>, pos: isize)

source§

fn reserve(vector: &mut QVector<Self>, size: isize)

source§

impl Eq for QByteArray

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> 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.