pub fn update_ref_vector_swap(self, lhs: usize, rhs: usize) -> Option<TypedValue> {
        let (vec_ty, vec_val, vec_ptr) = self.decompose();
        if cfg!(debug_assertions) {
            assert!(vec_ty.is_ref_vector(Some(true)));
        }
        let mut elems = vec_val.into_vector();
        if lhs >= elems.len() || rhs >= elems.len() {
            return None;
        }
        elems.swap(lhs, rhs);
        let new_vec = TypedValue {
            ty: vec_ty,
            val: BaseValue::mk_vector(elems),
            ptr: vec_ptr,
        };
        Some(new_vec)
    }
/// Swap two elements in the vector
Swap two elements in the vector
Swap two elements in the vector
pub fn update_ref_vector_swap(self, lhs: usize, rhs: usize) -> Option<TypedValue> {
        let (vec_ty, vec_val, vec_ptr) = self.decompose();
        if cfg!(debug_assertions) {
            assert!(vec_ty.is_ref_vector(Some(true)));
        }
        let mut elems = vec_val.into_vector();
        if lhs >= elems.len() || rhs >= elems.len() {
            return None;
        }
        elems.swap(lhs, rhs);
        let new_vec = TypedValue {
            ty: vec_ty,
            val: BaseValue::mk_vector(elems),
            ptr: vec_ptr,
        };
        Some(new_vec)
    }
pub fn update_ref_vector_swap ( self , lhs : usize , rhs : usize ) -> Option < TypedValue > { let ( vec_ty , vec_val , vec_ptr ) = self . decompose ( ) ; if cfg ! ( debug_assertions ) { assert ! ( vec_ty is_ref_vector ( Some ( true ) ) ) ; } let mut elems = vec_val . into_vector ( ) ; if lhs >= elems . len ( ) || rhs >= elems . len ( ) { return None ; } elems . swap ( lhs , rhs ) ; let new_vec = TypedValue { ty : vec_ty , val : BaseValue :: mk_vector ( elems ) , ptr : vec_ptr , } ; Some ( new_vec ) }
Swap two elements in the vector
Swap two elements in the vector
self
lhs
usize
rhs
usize