pub struct CRUDRepository<T: Entity = Row> { /* private fields */ }Implementations§
Source§impl CRUDRepository<Row>
impl CRUDRepository<Row>
pub fn new( connection: Arc<dyn Connection>, options: CRUDRepositoryOptions, ) -> Result<Self>
Source§impl<T: SchemaObject> CRUDRepository<T>
impl<T: SchemaObject> CRUDRepository<T>
pub fn new( connection: Arc<dyn Connection>, options: CRUDRepositoryOptions, ) -> Result<Self>
Source§impl<T: Entity> CRUDRepository<T>
impl<T: Entity> CRUDRepository<T>
pub fn with_write(self, write: Arc<dyn WriteEnrichmentStrategy<T>>) -> Self
pub fn add_enriched<TRelated: Entity>( &mut self, enrichment: Enrichment, via: impl EnrichmentVia<TRelated>, strategy: Option<Arc<dyn ReadonlyEnrichmentStrategy<T, TRelated>>>, ) -> &mut Self
pub fn add_linked<TRelated: Entity, TLink: Entity>( &mut self, enrichment: Enrichment, via: impl EnrichmentVia<TRelated>, link: Arc<dyn ICRUDRepository<TLink>>, strategy: Option<Arc<dyn ReadonlyEnrichmentStrategy<T, TRelated>>>, ) -> &mut Self
pub fn add_middleware(&self, middleware: Arc<dyn CommandMiddleware>)
pub async fn create(&self, item: T) -> Result<T>
pub async fn update( &self, item: T, by_where: Option<&dyn IWhere>, ) -> Result<Response>
pub async fn delete( &self, item: T, by_where: Option<&dyn IWhere>, ) -> Result<Response>
pub async fn read_single_by_id(&self, id: &dyn IdKey) -> Result<Option<T>>
Methods from Deref<Target = ReadonlyRepository<T>>§
pub fn schema(&self) -> &Schema
pub fn add_enriched<TRelated: Entity>( &mut self, enrichment: Enrichment, via: impl EnrichmentVia<TRelated>, strategy: Option<Arc<dyn ReadonlyEnrichmentStrategy<T, TRelated>>>, ) -> &mut Self
pub fn add_middleware(&mut self, middleware: Arc<dyn CommandMiddleware>)
pub async fn read_single( &self, query: Option<&dyn Statement>, options: Option<&ReadonlyRepositoryMappingOptions>, ) -> Result<Option<T>>
pub fn read<'a>( &'a self, query: Option<&'a dyn Statement>, options: Option<&'a ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Stream<Item = Result<T>> + Send + 'a>>
pub async fn read_single_where( &self, clause: &dyn IWhere, options: Option<&ReadonlyRepositoryMappingOptions>, ) -> Result<Option<T>>
pub fn read_where<'a>( &'a self, clause: &'a dyn IWhere, options: Option<&'a ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Stream<Item = Result<T>> + Send + 'a>>
Trait Implementations§
Source§impl<T: Entity> Deref for CRUDRepository<T>
impl<T: Entity> Deref for CRUDRepository<T>
Source§impl<T: Entity> DerefMut for CRUDRepository<T>
impl<T: Entity> DerefMut for CRUDRepository<T>
Source§impl<T: Entity> ICRUDRepository<T> for CRUDRepository<T>
impl<T: Entity> ICRUDRepository<T> for CRUDRepository<T>
fn create<'life0, 'async_trait>(
&'life0 self,
item: T,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
item: T,
by_where: Option<&'life1 dyn IWhere>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
item: T,
by_where: Option<&'life1 dyn IWhere>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn id_names(&self) -> Vec<String>
fn add_middleware(&self, middleware: Arc<dyn CommandMiddleware>)
fn read_single_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 dyn IdKey,
) -> Pin<Box<dyn Future<Output = Result<Option<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl<T: Entity> IReadonlyRepository<T> for CRUDRepository<T>
impl<T: Entity> IReadonlyRepository<T> for CRUDRepository<T>
fn to_crud(self: Arc<Self>) -> Option<Arc<dyn ICRUDRepository<T>>>
fn read_single<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: Option<&'life1 dyn Statement>,
options: Option<&'life2 ReadonlyRepositoryMappingOptions>,
) -> Pin<Box<dyn Future<Output = Result<Option<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read<'a>( &'a self, query: Option<&'a dyn Statement>, options: Option<&'a ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Stream<Item = Result<T>> + Send + 'a>>
fn read_single_where<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
clause: &'life1 dyn IWhere,
options: Option<&'life2 ReadonlyRepositoryMappingOptions>,
) -> Pin<Box<dyn Future<Output = Result<Option<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read_where<'a>( &'a self, clause: &'a dyn IWhere, options: Option<&'a ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Stream<Item = Result<T>> + Send + 'a>>
fn is_schema_required(&self) -> bool
Source§impl<T: Entity> IRepository for CRUDRepository<T>
impl<T: Entity> IRepository for CRUDRepository<T>
Auto Trait Implementations§
impl<T = HashMap<String, Value>> !RefUnwindSafe for CRUDRepository<T>
impl<T = HashMap<String, Value>> !UnwindSafe for CRUDRepository<T>
impl<T> Forget for CRUDRepository<T>
impl<T> Freeze for CRUDRepository<T>where
ReadonlyRepository<T>: Freeze,
RepositoryTree<T>: Freeze,
Arc<dyn WriteEnrichmentStrategy<T>>: Freeze,
PhantomData<T>: Freeze,
impl<T> Move for CRUDRepository<T>
impl<T> Send for CRUDRepository<T>where
ReadonlyRepository<T>: Send,
RepositoryTree<T>: Send,
Arc<dyn WriteEnrichmentStrategy<T>>: Send,
PhantomData<T>: Send,
impl<T> Sync for CRUDRepository<T>where
ReadonlyRepository<T>: Sync,
RepositoryTree<T>: Sync,
Arc<dyn WriteEnrichmentStrategy<T>>: Sync,
PhantomData<T>: Sync,
impl<T> Unpin for CRUDRepository<T>where
ReadonlyRepository<T>: Unpin,
RepositoryTree<T>: Unpin,
Arc<dyn WriteEnrichmentStrategy<T>>: Unpin,
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for CRUDRepository<T>where
ReadonlyRepository<T>: UnsafeUnpin,
RepositoryTree<T>: UnsafeUnpin,
Arc<dyn WriteEnrichmentStrategy<T>>: UnsafeUnpin,
PhantomData<T>: UnsafeUnpin,
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