pub trait VecHandle<T>{
// Required methods
async fn push(&self, value: T);
async fn is_empty(&self) -> bool;
async fn drain<R>(&self, range: R) -> Vec<T>
where R: RangeBounds<usize> + Send + Sync + 'static;
}Expand description
Extension methods for Handle<Vec<T>>, exposed as VecHandle.
Required Methods§
Sourceasync fn push(&self, value: T)
async fn push(&self, value: T)
Appends an element to the back of a collection.
§Examples
let handle = Handle::new(vec![1, 2]);
handle.push(100).await;
assert_eq!(handle.get().await, vec![1, 2, 100]);Sourceasync fn is_empty(&self) -> bool
async fn is_empty(&self) -> bool
Returns true if the vector contains no elements.
§Examples
let handle = Handle::new(Vec::<i32>::new());
assert!(handle.is_empty().await);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.