pub trait CoremgrOpDataModel: Sync {
// Required methods
fn init<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count<'life0, 'life1, 'async_trait>(
&'life0 self,
cond: &'life1 ListQueryCond<'_>
) -> Pin<Box<dyn Future<Output = Result<u64, Box<dyn StdError>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 ListOptions<'_>,
cursor: Option<Box<dyn Cursor>>
) -> Pin<Box<dyn Future<Output = Result<(Vec<CoremgrOpData>, Option<Box<dyn Cursor>>), Box<dyn StdError>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn add<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 CoremgrOpData
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn del<'life0, 'life1, 'async_trait>(
&'life0 self,
cond: &'life1 QueryCond<'_>
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Model operations.
Required Methods§
sourcefn init<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
To create and initialize the table/collection.
sourcefn count<'life0, 'life1, 'async_trait>(
&'life0 self,
cond: &'life1 ListQueryCond<'_>
) -> Pin<Box<dyn Future<Output = Result<u64, Box<dyn StdError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count<'life0, 'life1, 'async_trait>( &'life0 self, cond: &'life1 ListQueryCond<'_> ) -> Pin<Box<dyn Future<Output = Result<u64, Box<dyn StdError>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
To get item count for the query condition.
Note: this may take a long time.
sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 ListOptions<'_>,
cursor: Option<Box<dyn Cursor>>
) -> Pin<Box<dyn Future<Output = Result<(Vec<CoremgrOpData>, Option<Box<dyn Cursor>>), Box<dyn StdError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>( &'life0 self, opts: &'life1 ListOptions<'_>, cursor: Option<Box<dyn Cursor>> ) -> Pin<Box<dyn Future<Output = Result<(Vec<CoremgrOpData>, Option<Box<dyn Cursor>>), Box<dyn StdError>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
To get item list. The maximum number of returned items will be controlled by the
cursor_max
of the list option.
For the first time, cursor
MUST use None
. If one cursor is returned, it means that
there are more items to get. Use the returned cursor to get more data items.
Note: using cursors is recommended to prevent exhausting memory.