pub trait Repository {
type Entity: Debug + Clone;
type UIDType: UID;
// Required methods
fn find_by_uid(&self, uid: Self::UIDType) -> Result<Self::Entity, BaseError>;
fn create(&mut self, entity: Self::Entity) -> Result<(), BaseError>;
fn update_by_uid(
&mut self,
uid: Self::UIDType,
entity: Self::Entity,
) -> Result<(), BaseError>;
fn remove_by_uid(&mut self, uid: Self::UIDType) -> Result<(), BaseError>;
}Expand description
Repository is an trait abstraction used for Repository Pattern