pub struct BubbleSort<T> { /* private fields */ }
Expand description
bubble sort can customize the comparison logic based on the comparison function passed in
30
31
32
33
34
35
fn sort_by<F>(&mut self, f: F)
where
F: FnOnce(&T, &T) -> bool + core::marker::Copy,
{
let _ = self.bubble_sort_by(f);
}
Formats the value using the given formatter.
Read more
Converts to this type from the input type.
Converts to this type from the input type.
Get the internal data
Customizable comparison logic based on closures
Sort by ascending order
Determine if the sort is ascending
Customized judgments are ordered
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.