pub trait List: Sync + Send {
Show 14 methods
// Required methods
fn name(&self) -> &[u8] ⓘ;
fn push<'life0, 'life1, 'async_trait, V>(
&'life0 self,
val: &'life1 V,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where V: Serialize + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn pushs<'life0, 'async_trait, V>(
&'life0 self,
vals: Vec<V>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where V: Serialize + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
fn push_limit<'life0, 'life1, 'async_trait, V>(
&'life0 self,
val: &'life1 V,
limit: usize,
pop_front_if_limited: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
where V: Serialize + Sync + Send + DeserializeOwned + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn pop<'life0, 'async_trait, V>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
where V: DeserializeOwned + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
fn all<'life0, 'async_trait, V>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<V>>> + Send + 'async_trait>>
where V: DeserializeOwned + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
fn get_index<'life0, 'async_trait, V>(
&'life0 self,
idx: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
where V: DeserializeOwned + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
fn len<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn iter<'a, 'async_trait, V>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<V>> + Send + 'a>>> + Send + 'async_trait>>
where V: DeserializeOwned + Sync + Send + 'a + 'static + 'async_trait,
Self: 'async_trait,
'a: 'async_trait;
fn expire_at<'life0, 'async_trait>(
&'life0 self,
at: i64,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn expire<'life0, 'async_trait>(
&'life0 self,
dur: i64,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn ttl<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
List storage operations
Required Methods§
Sourcefn push<'life0, 'life1, 'async_trait, V>(
&'life0 self,
val: &'life1 V,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn push<'life0, 'life1, 'async_trait, V>( &'life0 self, val: &'life1 V, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Appends a value to the end of the list
Sourcefn pushs<'life0, 'async_trait, V>(
&'life0 self,
vals: Vec<V>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn pushs<'life0, 'async_trait, V>( &'life0 self, vals: Vec<V>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Appends multiple values to the list
Sourcefn push_limit<'life0, 'life1, 'async_trait, V>(
&'life0 self,
val: &'life1 V,
limit: usize,
pop_front_if_limited: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>where
V: Serialize + Sync + Send + DeserializeOwned + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn push_limit<'life0, 'life1, 'async_trait, V>(
&'life0 self,
val: &'life1 V,
limit: usize,
pop_front_if_limited: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>where
V: Serialize + Sync + Send + DeserializeOwned + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pushes with size limit and optional pop-front behavior
Sourcefn pop<'life0, 'async_trait, V>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
fn pop<'life0, 'async_trait, V>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
Removes and returns the first value in the list
Sourcefn all<'life0, 'async_trait, V>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<V>>> + Send + 'async_trait>>
fn all<'life0, 'async_trait, V>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<V>>> + Send + 'async_trait>>
Retrieves all values in the list
Sourcefn get_index<'life0, 'async_trait, V>(
&'life0 self,
idx: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
fn get_index<'life0, 'async_trait, V>( &'life0 self, idx: usize, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
Gets value by index
Sourcefn len<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn len<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets number of items in the list
Sourcefn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if list is empty
Sourcefn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clears all items from the list
Sourcefn iter<'a, 'async_trait, V>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<V>> + Send + 'a>>> + Send + 'async_trait>>where
V: DeserializeOwned + Sync + Send + 'a + 'static + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
fn iter<'a, 'async_trait, V>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncIterator<Item = Result<V>> + Send + 'a>>> + Send + 'async_trait>>where
V: DeserializeOwned + Sync + Send + 'a + 'static + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
Iterates over all values
Sourcefn expire_at<'life0, 'async_trait>(
&'life0 self,
at: i64,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn expire_at<'life0, 'async_trait>(
&'life0 self,
at: i64,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets expiration timestamp for the entire list (requires “ttl” feature)
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.