pub struct Elements<'list> { /* private fields */ }
Implementations§
Source§impl<'list> Elements<'list>
impl<'list> Elements<'list>
Sourcepub fn new(list: &'list [i32], desired: i32) -> Self
pub fn new(list: &'list [i32], desired: i32) -> Self
Returns a new instance of Elements
struct.
Sourcepub fn find_pivot(&mut self) -> &mut Self
pub fn find_pivot(&mut self) -> &mut Self
Performs a binary search to find the pivot point.
Sourcepub fn find_desired(&mut self) -> &Self
pub fn find_desired(&mut self) -> &Self
Again performs a binary search, but this time within a reduced range.
Auto Trait Implementations§
impl<'list> Freeze for Elements<'list>
impl<'list> RefUnwindSafe for Elements<'list>
impl<'list> Send for Elements<'list>
impl<'list> Sync for Elements<'list>
impl<'list> Unpin for Elements<'list>
impl<'list> UnwindSafe for Elements<'list>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more