Expand description
struct Vector is a new type pattern of Option<Vec
Tuple Fields
0: Option<Vec<T>>
Implementations
sourceimpl<T> Vector<T>
impl<T> Vector<T>
sourcepub fn with_inner(inner_vec: Vec<T>) -> Self
pub fn with_inner(inner_vec: Vec<T>) -> Self
Creates a new Vetocr with inner.
sourcepub fn init(&mut self, value: Option<Vec<T>>)
pub fn init(&mut self, value: Option<Vec<T>>)
Initialize this. After initialization, this inner Option<Vec
sourcepub fn with_first_elem(elem: T) -> Self
pub fn with_first_elem(elem: T) -> Self
Creates a new Vector with first element.
sourcepub fn has_at_least_one(&self) -> bool
pub fn has_at_least_one(&self) -> bool
Returns true if has some(n>0) items.
sourcepub fn append_vec(&mut self, other: Vec<T>)
pub fn append_vec(&mut self, other: Vec<T>)
Append other(Vec
sourcepub fn prepend_vec(&mut self, other: Vec<T>)
pub fn prepend_vec(&mut self, other: Vec<T>)
Prepend other(Vec
sourcepub fn has_inner_vec(&self) -> bool
pub fn has_inner_vec(&self) -> bool
Returns true if this has inner vec(as Some(Vec
sourcepub fn take_inner(&mut self) -> Option<Vec<T>>
pub fn take_inner(&mut self) -> Option<Vec<T>>
Takes inner
sourcepub fn get(&self, index: usize) -> Option<&T>
pub fn get(&self, index: usize) -> Option<&T>
Returns a reference to an element has index(usize).
sourcepub fn remove(&mut self, index: usize) -> T
pub fn remove(&mut self, index: usize) -> T
Removes and returns element at index. If index is out of bounds, will panic.
sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Removes last element of inner vec and returns it. If inner vec is empty or None, returns None.
sourcepub fn remove_last(&mut self) -> T
pub fn remove_last(&mut self) -> T
Removes last element of inner vec. If inner vec is empty of None, will panic.
sourcepub fn first_unwrap(&self) -> &T
pub fn first_unwrap(&self) -> &T
Returns first element of self. If Self is Vector(NOne), error occured.
sourceimpl<T> Vector<Vector<T>>
impl<T> Vector<Vector<T>>
sourcepub fn sum_of_length(&self) -> usize
pub fn sum_of_length(&self) -> usize
Returns the sum of inner Vectors’ len.
sourcepub fn length_of_last(&self) -> usize
pub fn length_of_last(&self) -> usize
Returns the len fo last of inner Vectors.
Trait Implementations
sourceimpl FlagSearch for Vector<Flag>
impl FlagSearch for Vector<Flag>
sourceimpl<T: FlagSearch> FlagSearch for Vector<T>
impl<T: FlagSearch> FlagSearch for Vector<T>
sourceimpl<T: PartialOrd> PartialOrd<Vector<T>> for Vector<T>
impl<T: PartialOrd> PartialOrd<Vector<T>> for Vector<T>
sourcefn partial_cmp(&self, other: &Vector<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Vector<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<T> StructuralPartialEq for Vector<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Vector<T> where
T: RefUnwindSafe,
impl<T> Send for Vector<T> where
T: Send,
impl<T> Sync for Vector<T> where
T: Sync,
impl<T> Unpin for Vector<T> where
T: Unpin,
impl<T> UnwindSafe for Vector<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more