pub struct PostgresOperations {
pub pool: Pool<Postgres>,
}
Expand description
PostgreSQL 数据库操作实现
Fields§
§pool: Pool<Postgres>
Implementations§
Trait Implementations§
Source§impl InstalledModelRepository<Postgres> for PostgresOperations
impl InstalledModelRepository<Postgres> for PostgresOperations
Source§fn get_all_installed_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<InstalledModel>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_installed_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<InstalledModel>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取所有已安装模型
Source§fn get_installed_model_by_model_id<'life0, 'async_trait>(
&'life0 self,
_model_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<InstalledModel>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_installed_model_by_model_id<'life0, 'async_trait>(
&'life0 self,
_model_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<InstalledModel>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
根据模型ID获取已安装模型
Source§fn install_model<'life0, 'life1, 'async_trait>(
&'life0 self,
_installed_model: &'life1 InstalledModel,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn install_model<'life0, 'life1, 'async_trait>(
&'life0 self,
_installed_model: &'life1 InstalledModel,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
安装模型
Source§fn update_installed_model<'life0, 'life1, 'async_trait>(
&'life0 self,
_installed_model: &'life1 InstalledModel,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_installed_model<'life0, 'life1, 'async_trait>(
&'life0 self,
_installed_model: &'life1 InstalledModel,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
更新已安装模型
Source§fn uninstall_model<'life0, 'async_trait>(
&'life0 self,
_model_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn uninstall_model<'life0, 'async_trait>(
&'life0 self,
_model_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
卸载模型
Source§fn get_installed_models_by_status<'life0, 'life1, 'async_trait>(
&'life0 self,
_status: &'life1 ModelStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<InstalledModel>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_installed_models_by_status<'life0, 'life1, 'async_trait>(
&'life0 self,
_status: &'life1 ModelStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<InstalledModel>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
按状态获取已安装模型
Source§impl ModelRepository<Postgres> for PostgresOperations
impl ModelRepository<Postgres> for PostgresOperations
Source§fn get_all_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Model>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Model>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取所有模型
Source§fn get_model_by_id<'life0, 'async_trait>(
&'life0 self,
_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Model>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_model_by_id<'life0, 'async_trait>(
&'life0 self,
_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Model>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
根据ID获取模型
Source§fn get_model_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Model>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_model_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Model>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
根据名称获取模型
Source§fn create_model<'life0, 'life1, 'async_trait>(
&'life0 self,
_model: &'life1 Model,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_model<'life0, 'life1, 'async_trait>(
&'life0 self,
_model: &'life1 Model,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
创建新模型
Source§fn update_model<'life0, 'life1, 'async_trait>(
&'life0 self,
_model: &'life1 Model,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_model<'life0, 'life1, 'async_trait>(
&'life0 self,
_model: &'life1 Model,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
更新模型
Source§fn delete_model<'life0, 'async_trait>(
&'life0 self,
_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_model<'life0, 'async_trait>(
&'life0 self,
_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
删除模型
Source§fn search_models<'life0, 'life1, 'async_trait>(
&'life0 self,
_query: &'life1 str,
_limit: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Model>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_models<'life0, 'life1, 'async_trait>(
&'life0 self,
_query: &'life1 str,
_limit: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Model>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
搜索模型
Auto Trait Implementations§
impl Freeze for PostgresOperations
impl !RefUnwindSafe for PostgresOperations
impl Send for PostgresOperations
impl Sync for PostgresOperations
impl Unpin for PostgresOperations
impl !UnwindSafe for PostgresOperations
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more