PostgresOperations

Struct PostgresOperations 

Source
pub struct PostgresOperations {
    pub pool: Pool<Postgres>,
}
Expand description

PostgreSQL 数据库操作实现

Fields§

§pool: Pool<Postgres>

Implementations§

Trait Implementations§

Source§

impl DatabaseRepository<Postgres> for PostgresOperations

Source§

type Error = RepositoryError

Source§

fn pool<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = &Pool<Postgres>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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,

获取所有已安装模型
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,

根据模型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,

安装模型
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,

更新已安装模型
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,

卸载模型
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,

按状态获取已安装模型
Source§

fn update_model_usage<'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§

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,

获取所有模型
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,

根据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,

根据名称获取模型
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,

创建新模型
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,

更新模型
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,

删除模型
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,

搜索模型
Source§

fn get_models_by_type<'life0, 'life1, 'async_trait>( &'life0 self, _model_type: &'life1 ModelType, ) -> Pin<Box<dyn Future<Output = Result<Vec<Model>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

按类型获取模型
Source§

fn get_models_by_provider<'life0, 'life1, 'async_trait>( &'life0 self, _provider: &'life1 str, ) -> 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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,