[−][src]Trait opencv::prelude::Vector
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
Loading content...Required methods
fn new() -> Self where
Self: Sized,
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
Provided methods
fn from_iter(s: impl IntoIterator<Item = Self::Arg>) -> Self where
Self: Sized,
Self: Sized,
Create a Vector from iterator
fn with_capacity(capacity: size_t) -> Self where
Self: Sized,
Self: Sized,
Create a Vector with pre-defined capacity
fn to_vec(&self) -> Vec<Self::Storage>
Convert to Rust Vec