pub struct InMemoryDataSource { /* private fields */ }Expand description
An in-memory DataSource used as the default backing store.
Rows are keyed by model name; each row is a JSON object. This is a real, fully-functional store (create/read/update/delete, search, filter, ordering and pagination) — just not a persistent one.
Implementations§
Trait Implementations§
Source§impl DataSource for InMemoryDataSource
impl DataSource for InMemoryDataSource
Source§fn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
query: &'life2 DataQuery,
) -> Pin<Box<dyn Future<Output = DataPage> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
query: &'life2 DataQuery,
) -> Pin<Box<dyn Future<Output = DataPage> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch a page of rows for a list view. Read more
Source§fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch a single record by primary-key value.
Source§fn count<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Total number of records for a model (used by the dashboard summaries).
Source§fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<String, AdminError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<String, AdminError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a record, returning its primary-key value.
Source§fn update<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
id: &'life2 str,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<(), AdminError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
id: &'life2 str,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<(), AdminError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update an existing record.
Source§fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AdminError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 ModelDefinition,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AdminError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete a record.
Source§impl Default for InMemoryDataSource
impl Default for InMemoryDataSource
Source§fn default() -> InMemoryDataSource
fn default() -> InMemoryDataSource
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryDataSource
impl !RefUnwindSafe for InMemoryDataSource
impl Send for InMemoryDataSource
impl Sync for InMemoryDataSource
impl Unpin for InMemoryDataSource
impl UnsafeUnpin for InMemoryDataSource
impl UnwindSafe for InMemoryDataSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging