pub trait Contract {
// Required method
fn contract(&mut self, count: usize);
}
Expand description
Opposite of Extend
.
Required Methods§
Sourcefn contract(&mut self, count: usize)
fn contract(&mut self, count: usize)
Contracts the collection, removing the given number of items from its end.
§Overflow Behavior
This method may panic if count
is larger than the size of the collection.
Since this check may incur performance penalities, it is only guaranteed if
debug assertions are enabled.
In these cases, the collection must still correctly remove the elements, but may decide to not notify the user that less than the count of items were removed.
Implementations on Foreign Types§
Source§impl<T> Contract for LinkedList<T>
Pops items off the back of the LinkedList
.
impl<T> Contract for LinkedList<T>
Pops items off the back of the LinkedList
.