Struct qwt::qvector::QVector

source ·
pub struct QVector { /* private fields */ }

Implementations§

source§

impl QVector

source

pub fn is_empty(&self) -> bool

Check if the vector is empty.

§Examples
use qwt::QVector;

let qv = QVector::default();
assert!(qv.is_empty());
source

pub fn len(&self) -> usize

Return the number of symbols in the quaternary vector.

§Examples
use qwt::QVector;

let qv: QVector = [0, 1, 2, 3].into_iter().cycle().take(10).collect();
assert_eq!(qv.len(), 10);
source

pub fn iter(&self) -> QVectorIterator<&QVector>

Return an iterator over the values in the quad vector.

§Examples
use qwt::QVector;

let qv: QVector = [0, 1, 2, 3].into_iter().cycle().take(100).collect();;

for (i, v) in qv.iter().enumerate() {
   assert_eq!((i%4) as u8, v);
}

Trait Implementations§

source§

impl AccessQuad for QVector

source§

unsafe fn get_unchecked(&self, i: usize) -> u8

Access the ith value in the quaternary vector.

§Safety

Calling this method with an out-of-bounds index is undefined behavior.

§Examples
use qwt::{QVector, AccessQuad};

let qv: QVector = [0, 1, 2, 3].into_iter().cycle().take(10).collect();
unsafe {
    assert_eq!(qv.get_unchecked(8), 0);
}
source§

fn get(&self, i: usize) -> Option<u8>

Access the ith value in the quaternary vector or None if i is out of bounds.

§Examples
use qwt::QVector;
use qwt::AccessQuad;

let qv: QVector = [0, 1, 2, 3].into_iter().cycle().take(10).collect();

assert_eq!(qv.get(8), Some(0));
assert_eq!(qv.get(10), None);
source§

impl AsRef<QVector> for QVector

source§

fn as_ref(&self) -> &QVector

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for QVector

source§

fn clone(&self) -> QVector

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for QVector

source§

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

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

impl Default for QVector

source§

fn default() -> QVector

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for QVector

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<S: RSSupport> From<QVector> for RSQVector<S>

source§

fn from(qv: QVector) -> Self

Converts a given quad vector qv into a RSQVector with support for rank and select queries.

§Examples
use qwt::RSQVector256;

let rsqv: RSQVector256 = (0..10_u64).into_iter().map(|x| x % 4).collect();

assert_eq!(rsqv.is_empty(), false);
assert_eq!(rsqv.len(), 10);
source§

impl<T> FromIterator<T> for QVector
where T: PrimInt + AsPrimitive<u8>,

source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
source§

impl<'a> IntoIterator for &'a QVector

§

type IntoIter = QVectorIterator<&'a QVector>

Which kind of iterator are we turning this into?
§

type Item = u8

The type of the elements being iterated over.
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoIterator for QVector

§

type IntoIter = QVectorIterator<QVector>

Which kind of iterator are we turning this into?
§

type Item = u8

The type of the elements being iterated over.
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq for QVector

source§

fn eq(&self, other: &QVector) -> 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 Serialize for QVector

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SpaceUsage for QVector

source§

fn space_usage_byte(&self) -> usize

Gives the space usage of the data structure in bytes.
source§

fn space_usage_KiB(&self) -> f64

Gives the space usage of the data structure in KiB.
source§

fn space_usage_MiB(&self) -> f64

Gives the space usage of the data structure in MiB.
source§

fn space_usage_GiB(&self) -> f64

Gives the space usage of the data structure in GiB.
source§

impl Eq for QVector

source§

impl StructuralPartialEq for QVector

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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, 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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,