pub fn remove(&mut self, key: &Key) -> Expired<T> {
        self.remove_key(key);
        let data = self.slab.remove(key.index);

        Expired {
            key: Key::new(key.index),
            data: data.inner,
            deadline: self.start + Duration::from_millis(data.when),
        }
    }
/// Removes the item associated with `key` from the queue.
///
/// There must be an item associated with `key`. The function returns the
/// removed item as well as the `Instant` at which it will the delay will
/// have expired.
///
/// # Panics
///
/// The function panics if `key` is not contained by the queue.
///
/// # Examples
///
/// Basic usage
///
/// ```rust
/// use tokio_util::time::DelayQueue;
/// use std::time::Duration;
///
/// # #[tokio::main]
/// # async fn main() {
/// let mut delay_queue = DelayQueue::new();
/// let key = delay_queue.insert("foo", Duration::from_secs(5));
///
/// // Remove the entry
/// let item = delay_queue.remove(&key);
/// assert_eq!(*item.get_ref(), "foo");
/// # }
/// ```
Removes the item associated with `key` from the queue.
There must be an item associated with `key`. The function returns the
removed item as well as the `Instant` at which it will the delay will
have expired.
Removes the item associated with ` key ` from the queue . There must be an item associated with ` key ` . The function returns the removed item as well as the ` Instant ` at which it will the delay will have expired .
pub fn remove(&mut self, key: &Key) -> Expired<T> {
        self.remove_key(key);
        let data = self.slab.remove(key.index);
        Expired {
            key: Key::new(key.index),
            data: data.inner,
            deadline: self.start + Duration::from_millis(data.when),
        }
    }
pub fn remove ( & mut self , key : & Key ) -> Expired < T > { self . remove_key ( key ) ; let data = self . slab . remove ( key . index ) ; Expired { key : Key :: new ( key . index ) , data : data . inner , deadline : self . start + Duration :: from_millis ( data . when ) , } }
Removes the item associated with `key` from the queue.
Removes the item associated with ` key ` from the queue .
&mut self
key
&Key
panics
The function panics if `key` is not contained by the queue.
The function panics if ` key ` is not contained by the queue .
examples
Basic usage

```rust
use tokio_util::time::DelayQueue;
use std::time::Duration.
Basic usage ` ` ` rust use tokio_util :: time :: DelayQueue ; use std :: time :: Duration .
#[tokio::main]
None
async fn main() {
let mut delay_queue = DelayQueue::new();
let key = delay_queue.insert("foo", Duration::from_secs(5)).

Remove the entry
let item = delay_queue.remove(&key);
assert_eq!(*item.get_ref(), "foo").
let mut delay_queue = DelayQueue :: new () ; let key = delay_queue . insert ( " foo " Duration :: from_secs ( 5 )) . Remove the entry let item = delay_queue . remove ( &key ) ; assert_eq! ( * item . get_ref () " foo " ) .
}
None