List

Trait List 

Source
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§

Source

fn name(&self) -> &[u8]

Gets the name of this list

Source

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,

Appends a value to the end of the list

Source

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,

Appends multiple values to the list

Source

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

Source

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,

Removes and returns the first value in the list

Source

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,

Retrieves all values in the list

Source

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,

Gets value by index

Source

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

Source

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

Source

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

Source

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

Source

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)

Source

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,

Sets expiration duration for the entire list (requires “ttl” feature)

Source

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,

Gets remaining time-to-live for the 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.

Implementors§