[][src]Struct opencv::core::Vec4

#[repr(C)]pub struct Vec4<T: ValidVecType>(pub [T; 4]);

Implementations

impl<T: ValidVecType> Vec4<T>[src]

pub fn all(v0: T) -> Self[src]

Methods from Deref<Target = [T; 4]>

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

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

🔬 This is a nightly-only experimental API. (array_methods)

Returns a slice containing the entire array. Equivalent to &s[..].

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

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

🔬 This is a nightly-only experimental API. (array_methods)

Returns a mutable slice containing the entire array. Equivalent to &mut s[..].

pub fn each_ref(&self) -> [&T; N][src]

🔬 This is a nightly-only experimental API. (array_methods)

Borrows each element and returns an array of references with the same size as self.

Example

#![feature(array_methods)]

let floats = [3.1, 2.7, -1.0];
let float_refs: [&f64; 3] = floats.each_ref();
assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);

This method is particularly useful if combined with other methods, like map. This way, you can can avoid moving the original array if its elements are not Copy.

#![feature(array_methods, array_map)]

let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
let is_ascii = strings.each_ref().map(|s| s.is_ascii());
assert_eq!(is_ascii, [true, false, true]);

// We can still access the original array: it has not been moved.
assert_eq!(strings.len(), 3);

pub fn each_mut(&mut self) -> [&mut T; N][src]

🔬 This is a nightly-only experimental API. (array_methods)

Borrows each element mutably and returns an array of mutable references with the same size as self.

Example

#![feature(array_methods)]

let mut floats = [3.1, 2.7, -1.0];
let float_refs: [&mut f64; 3] = floats.each_mut();
*float_refs[0] = 0.0;
assert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);
assert_eq!(floats, [0.0, 2.7, -1.0]);

Trait Implementations

impl<T: Clone + ValidVecType> Clone for Vec4<T>[src]

impl<T: Copy + ValidVecType> Copy for Vec4<T>[src]

impl DataType for Vec4<i8>[src]

impl DataType for Vec4<u16>[src]

impl<T: Debug + ValidVecType> Debug for Vec4<T>[src]

impl<T: Default + ValidVecType> Default for Vec4<T>[src]

impl<T: ValidVecType> Deref for Vec4<T>[src]

type Target = [T; 4]

The resulting type after dereferencing.

impl<T: ValidVecType> DerefMut for Vec4<T>[src]

impl<T: ValidVecType> From<[T; 4]> for Vec4<T>[src]

impl<T: PartialEq + ValidVecType> PartialEq<Vec4<T>> for Vec4<T>[src]

impl<T: PartialOrd + ValidVecType> PartialOrd<Vec4<T>> for Vec4<T>[src]

impl<T: ValidVecType> StructuralPartialEq for Vec4<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Vec4<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Vec4<T> where
    T: Send
[src]

impl<T> Sync for Vec4<T> where
    T: Sync
[src]

impl<T> Unpin for Vec4<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Vec4<T> where
    T: UnwindSafe
[src]

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> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.