[][src]Trait opencv::prelude::Vector

pub trait Vector<'i> {
    type Storage;
    type Arg;
    fn new() -> Self
    where
        Self: Sized
;
fn len(&self) -> size_t;
fn is_empty(&self) -> bool;
fn capacity(&self) -> size_t;
fn shrink_to_fit(&mut self);
fn reserve(&mut self, additional: size_t);
fn clear(&mut self);
fn push(&mut self, val: Self::Arg);
fn insert(&mut self, index: size_t, val: Self::Arg) -> Result<()>;
fn remove(&mut self, index: size_t) -> Result<()>;
fn swap(&mut self, index1: size_t, index2: size_t) -> Result<()>;
fn get(&self, index: size_t) -> Result<Self::Storage>;
unsafe fn get_unchecked(&self, index: size_t) -> Self::Storage;
fn set(&mut self, index: size_t, val: Self::Arg) -> Result<()>;
unsafe fn set_unchecked(&mut self, index: size_t, val: Self::Arg); fn from_iter(s: impl IntoIterator<Item = Self::Arg>) -> Self
    where
        Self: Sized
, { ... }
fn with_capacity(capacity: size_t) -> Self
    where
        Self: Sized
, { ... }
fn to_vec(&self) -> Vec<Self::Storage> { ... } }

Common interface for all C++ vector types generated by the crate

You'll need to import this trait to use any of the C++ vector wrappers, usually imported as part of the prelude.

Associated Types

type Storage

type Arg

Loading content...

Required methods

fn new() -> Self where
    Self: Sized

Create a new Vector

fn len(&self) -> size_t

Return Vector length

fn is_empty(&self) -> bool

Return true if Vector is empty

fn capacity(&self) -> size_t

Return Vector current capacity

fn shrink_to_fit(&mut self)

Free extra capacity

fn reserve(&mut self, additional: size_t)

Reserve capacity for additional new elements

fn clear(&mut self)

Remove all elements

fn push(&mut self, val: Self::Arg)

Add new element

fn insert(&mut self, index: size_t, val: Self::Arg) -> Result<()>

Insert a new element at the specified index

fn remove(&mut self, index: size_t) -> Result<()>

Remove the element at the specified index

fn swap(&mut self, index1: size_t, index2: size_t) -> Result<()>

Swaps 2 elements in the Vector

fn get(&self, index: size_t) -> Result<Self::Storage>

Get element at the specified index

unsafe fn get_unchecked(&self, index: size_t) -> Self::Storage

Same as get() but without bounds checking

fn set(&mut self, index: size_t, val: Self::Arg) -> Result<()>

Set element at the specified index

unsafe fn set_unchecked(&mut self, index: size_t, val: Self::Arg)

Same as set() but without bounds checking

Loading content...

Provided methods

fn from_iter(s: impl IntoIterator<Item = Self::Arg>) -> Self where
    Self: Sized

Create a Vector from iterator

fn with_capacity(capacity: size_t) -> Self where
    Self: Sized

Create a Vector with pre-defined capacity

fn to_vec(&self) -> Vec<Self::Storage>

Convert to Rust Vec

Loading content...

Implementors

impl<'i> Vector<'i> for VectorOfDMatch[src]

type Storage = DMatch

type Arg = DMatch

impl<'i> Vector<'i> for VectorOfDPMDetector_ObjectDetection[src]

type Storage = DPMDetector_ObjectDetection

type Arg = DPMDetector_ObjectDetection

impl<'i> Vector<'i> for VectorOfDTrees_Node[src]

type Storage = DTrees_Node

type Arg = DTrees_Node

impl<'i> Vector<'i> for VectorOfDTrees_Split[src]

type Storage = DTrees_Split

type Arg = DTrees_Split

impl<'i> Vector<'i> for VectorOfDetail_CameraParams[src]

type Storage = Detail_CameraParams

type Arg = Detail_CameraParams

impl<'i> Vector<'i> for VectorOfDetail_ImageFeatures[src]

type Storage = Detail_ImageFeatures

type Arg = Detail_ImageFeatures

impl<'i> Vector<'i> for VectorOfDetail_MatchesInfo[src]

type Storage = Detail_MatchesInfo

type Arg = Detail_MatchesInfo

impl<'i> Vector<'i> for VectorOfDetectionBasedTracker_ExtObject[src]

type Storage = DetectionBasedTracker_ExtObject

type Arg = DetectionBasedTracker_ExtObject

impl<'i> Vector<'i> for VectorOfDetectionROI[src]

type Storage = DetectionROI

type Arg = DetectionROI

impl<'i> Vector<'i> for VectorOfERStat[src]

type Storage = ERStat

type Arg = ERStat

impl<'i> Vector<'i> for VectorOfElliptic_KeyPoint[src]

type Storage = Elliptic_KeyPoint

type Arg = Elliptic_KeyPoint

impl<'i> Vector<'i> for VectorOfFacemarkAAM_Config[src]

type Storage = FacemarkAAM_Config

type Arg = FacemarkAAM_Config

impl<'i> Vector<'i> for VectorOfFacemarkAAM_Model_Texture[src]

type Storage = FacemarkAAM_Model_Texture

type Arg = FacemarkAAM_Model_Texture

impl<'i> Vector<'i> for VectorOfFlannIndexType[src]

type Storage = FlannIndexType

type Arg = FlannIndexType

impl<'i> Vector<'i> for VectorOfKeyLine[src]

type Storage = KeyLine

type Arg = KeyLine

impl<'i> Vector<'i> for VectorOfKeyPoint[src]

type Storage = KeyPoint

type Arg = KeyPoint

impl<'i> Vector<'i> for VectorOfMat[src]

type Storage = Mat

type Arg = Mat

impl<'i> Vector<'i> for VectorOfMatShape[src]

type Storage = MatShape

type Arg = MatShape

impl<'i> Vector<'i> for VectorOfPlatformInfo[src]

type Storage = PlatformInfo

type Arg = PlatformInfo

impl<'i> Vector<'i> for VectorOfPoint[src]

type Storage = Point

type Arg = Point

impl<'i> Vector<'i> for VectorOfPoint2d[src]

type Storage = Point2d

type Arg = Point2d

impl<'i> Vector<'i> for VectorOfPoint2f[src]

type Storage = Point2f

type Arg = Point2f

impl<'i> Vector<'i> for VectorOfPoint3d[src]

type Storage = Point3d

type Arg = Point3d

impl<'i> Vector<'i> for VectorOfPoint3f[src]

type Storage = Point3f

type Arg = Point3f

impl<'i> Vector<'i> for VectorOfPoint3i[src]

type Storage = Point3i

type Arg = Point3i

impl<'i> Vector<'i> for VectorOfPose3DPtr[src]

type Storage = Pose3DPtr

type Arg = Pose3DPtr

impl<'i> Vector<'i> for VectorOfPtrOfBackendNode[src]

type Storage = PtrOfBackendNode

type Arg = PtrOfBackendNode

impl<'i> Vector<'i> for VectorOfPtrOfBackendWrapper[src]

type Storage = PtrOfBackendWrapper

type Arg = PtrOfBackendWrapper

impl<'i> Vector<'i> for VectorOfPtrOfLayer[src]

type Storage = PtrOfLayer

type Arg = PtrOfLayer

impl<'i> Vector<'i> for VectorOfRange[src]

type Storage = Range

type Arg = Range

impl<'i> Vector<'i> for VectorOfRect[src]

type Storage = Rect

type Arg = Rect

impl<'i> Vector<'i> for VectorOfRect2d[src]

type Storage = Rect2d

type Arg = Rect2d

impl<'i> Vector<'i> for VectorOfRotatedRect[src]

type Storage = RotatedRect

type Arg = RotatedRect

impl<'i> Vector<'i> for VectorOfScalar[src]

type Storage = Scalar

type Arg = Scalar

impl<'i> Vector<'i> for VectorOfSize[src]

type Storage = Size

type Arg = Size

impl<'i> Vector<'i> for VectorOfString[src]

type Storage = String

type Arg = &'i str

impl<'i> Vector<'i> for VectorOfTarget[src]

type Storage = Target

type Arg = Target

impl<'i> Vector<'i> for VectorOfUMat[src]

type Storage = UMat

type Arg = UMat

impl<'i> Vector<'i> for VectorOfVec2i[src]

type Storage = Vec2i

type Arg = Vec2i

impl<'i> Vector<'i> for VectorOfVec3d[src]

type Storage = Vec3d

type Arg = Vec3d

impl<'i> Vector<'i> for VectorOfVec3f[src]

type Storage = Vec3f

type Arg = Vec3f

impl<'i> Vector<'i> for VectorOfVec3i[src]

type Storage = Vec3i

type Arg = Vec3i

impl<'i> Vector<'i> for VectorOfVec4f[src]

type Storage = Vec4f

type Arg = Vec4f

impl<'i> Vector<'i> for VectorOfVec4i[src]

type Storage = Vec4i

type Arg = Vec4i

impl<'i> Vector<'i> for VectorOfVec6f[src]

type Storage = Vec6f

type Arg = Vec6f

impl<'i> Vector<'i> for VectorOfVectorOfDMatch[src]

type Storage = VectorOfDMatch

type Arg = VectorOfDMatch

impl<'i> Vector<'i> for VectorOfVectorOfERStat[src]

type Storage = VectorOfERStat

type Arg = VectorOfERStat

impl<'i> Vector<'i> for VectorOfVectorOfKeyLine[src]

type Storage = VectorOfKeyLine

type Arg = VectorOfKeyLine

impl<'i> Vector<'i> for VectorOfVectorOfKeyPoint[src]

type Storage = VectorOfKeyPoint

type Arg = VectorOfKeyPoint

impl<'i> Vector<'i> for VectorOfVectorOfMat[src]

type Storage = VectorOfMat

type Arg = VectorOfMat

impl<'i> Vector<'i> for VectorOfVectorOfMatShape[src]

type Storage = VectorOfMatShape

type Arg = VectorOfMatShape

impl<'i> Vector<'i> for VectorOfVectorOfPoint[src]

type Storage = VectorOfPoint

type Arg = VectorOfPoint

impl<'i> Vector<'i> for VectorOfVectorOfPoint2f[src]

type Storage = VectorOfPoint2f

type Arg = VectorOfPoint2f

impl<'i> Vector<'i> for VectorOfVectorOfPoint3d[src]

type Storage = VectorOfPoint3d

type Arg = VectorOfPoint3d

impl<'i> Vector<'i> for VectorOfVectorOfPoint3f[src]

type Storage = VectorOfPoint3f

type Arg = VectorOfPoint3f

impl<'i> Vector<'i> for VectorOfVectorOfPoint3i[src]

type Storage = VectorOfPoint3i

type Arg = VectorOfPoint3i

impl<'i> Vector<'i> for VectorOfVectorOfRange[src]

type Storage = VectorOfRange

type Arg = VectorOfRange

impl<'i> Vector<'i> for VectorOfVectorOfVec2i[src]

type Storage = VectorOfVec2i

type Arg = VectorOfVec2i

impl<'i> Vector<'i> for VectorOfVectorOff64[src]

type Storage = VectorOff64

type Arg = VectorOff64

impl<'i> Vector<'i> for VectorOfVectorOfi32[src]

type Storage = VectorOfi32

type Arg = VectorOfi32

impl<'i> Vector<'i> for VectorOfVectorOfi8[src]

type Storage = VectorOfi8

type Arg = VectorOfi8

impl<'i> Vector<'i> for VectorOfVectorOfu8[src]

type Storage = VectorOfu8

type Arg = VectorOfu8

impl<'i> Vector<'i> for VectorOfVideoCapture[src]

type Storage = VideoCapture

type Arg = VideoCapture

impl<'i> Vector<'i> for VectorOfVideoCaptureAPIs[src]

type Storage = VideoCaptureAPIs

type Arg = VideoCaptureAPIs

impl<'i> Vector<'i> for VectorOfbool[src]

type Storage = bool

type Arg = bool

impl<'i> Vector<'i> for VectorOff32[src]

type Storage = f32

type Arg = f32

impl<'i> Vector<'i> for VectorOff64[src]

type Storage = f64

type Arg = f64

impl<'i> Vector<'i> for VectorOfi32[src]

type Storage = i32

type Arg = i32

impl<'i> Vector<'i> for VectorOfi8[src]

type Storage = i8

type Arg = i8

impl<'i> Vector<'i> for VectorOfsize_t[src]

type Storage = size_t

type Arg = size_t

impl<'i> Vector<'i> for VectorOfu8[src]

type Storage = u8

type Arg = u8

Loading content...