diff --git a/src/database/connection.rs b/src/database/connection.rs index be47f9da..34b82081 100644 --- a/src/database/connection.rs +++ b/src/database/connection.rs @@ -4,7 +4,7 @@ use crate::{ use futures::Stream; use std::{future::Future, pin::Pin}; -/// Creates constraints for any structure that wants to create a database connection +/// Creates constraints for any structure that can create a database connection /// and execute SQL statements #[async_trait::async_trait] pub trait ConnectionTrait<'a>: Sync { diff --git a/src/driver/mock.rs b/src/driver/mock.rs index 3f271759..c0ffa0a2 100644 --- a/src/driver/mock.rs +++ b/src/driver/mock.rs @@ -23,7 +23,7 @@ pub struct MockDatabaseConnection { mocker: Mutex>, } -/// A set of constraints for any type wanting to perform operations on the [MockDatabase] +/// A Trait for any type wanting to perform operations on the [MockDatabase] pub trait MockDatabaseTrait: Send + Debug { /// Execute a statement in the [MockDatabase] fn execute(&mut self, counter: usize, stmt: Statement) -> Result; diff --git a/src/entity/active_model.rs b/src/entity/active_model.rs index d46c6dbf..c58ea5a9 100644 --- a/src/entity/active_model.rs +++ b/src/entity/active_model.rs @@ -76,12 +76,12 @@ where ActiveValue::unchanged(value) } -/// Enforces a set of constraints on any type performing an Create, Update or Delete operation. +/// A Trait for ActiveModel to perform Create, Update or Delete operation. /// The type must also implement the [EntityTrait]. /// See module level docs [crate::entity] for a full example #[async_trait] pub trait ActiveModelTrait: Clone + Debug { - /// Enforce the type to the constraints of the [EntityTrait] + /// The Entity this ActiveModel belongs to type Entity: EntityTrait; /// Get a mutable [ActiveValue] from an ActiveModel @@ -208,9 +208,7 @@ pub trait ActiveModelTrait: Clone + Debug { } } -/// Enforce a set of constraints to a override the ActiveModel behavior -/// Behaviors for users to override. -/// The type must also implement the [ActiveModelTrait] +/// A Trait for overriding the ActiveModel behavior /// /// ### Example /// ```ignore @@ -265,7 +263,7 @@ pub trait ActiveModelBehavior: ActiveModelTrait { } } -/// Enforce constraints for conversion to an ActiveModel +/// A Trait for any type that can be converted into an ActiveModel pub trait IntoActiveModel where A: ActiveModelTrait, diff --git a/src/entity/base_entity.rs b/src/entity/base_entity.rs index c03199d7..9c8a921d 100644 --- a/src/entity/base_entity.rs +++ b/src/entity/base_entity.rs @@ -13,7 +13,7 @@ pub trait IdenStatic: Iden + Copy + Debug + 'static { fn as_str(&self) -> &str; } -/// Enforces the naming of an entity to a set of constraints +/// A Trait for mapping an Entity to a database table pub trait EntityName: IdenStatic + Default { /// Method to get the name for the schema, defaults to [Option::None] if not set fn schema_name(&self) -> Option<&str> { diff --git a/src/entity/link.rs b/src/entity/link.rs index 53d23b97..b929624d 100644 --- a/src/entity/link.rs +++ b/src/entity/link.rs @@ -6,7 +6,7 @@ use sea_query::{Alias, IntoIden, JoinType, SeaRc}; /// Same as [RelationDef] pub type LinkDef = RelationDef; -/// A set of constraints for links between Entities +/// A Trait for links between Entities pub trait Linked { #[allow(missing_docs)] type FromEntity: EntityTrait; diff --git a/src/entity/model.rs b/src/entity/model.rs index 3f162dbe..b11a700b 100644 --- a/src/entity/model.rs +++ b/src/entity/model.rs @@ -5,7 +5,7 @@ use crate::{ pub use sea_query::Value; use std::fmt::Debug; -/// A set of constraints for a Model +/// A Trait for a Model pub trait ModelTrait: Clone + Send + Debug { #[allow(missing_docs)] type Entity: EntityTrait; @@ -35,7 +35,7 @@ pub trait ModelTrait: Clone + Send + Debug { } } -/// A set of constraints for implementing a [QueryResult] +/// A Trait for implementing a [QueryResult] pub trait FromQueryResult: Sized { /// Instantiate a Model from a [QueryResult] fn from_query_result(res: &QueryResult, pre: &str) -> Result; diff --git a/src/entity/primary_key.rs b/src/entity/primary_key.rs index d4075a2c..2c596dde 100644 --- a/src/entity/primary_key.rs +++ b/src/entity/primary_key.rs @@ -4,7 +4,7 @@ use sea_query::{FromValueTuple, IntoValueTuple}; use std::fmt::Debug; //LINT: composite primary key cannot auto increment -/// A set of constraints to be used to define a Primary Key. +/// A Trait for to be used to define a Primary Key. /// /// A primary key can be derived manually /// diff --git a/src/executor/paginator.rs b/src/executor/paginator.rs index c8bd503a..f52b3bd8 100644 --- a/src/executor/paginator.rs +++ b/src/executor/paginator.rs @@ -159,7 +159,7 @@ where } #[async_trait::async_trait] -/// Used to enforce constraints on any type that wants to paginate results +/// A Trait for any type that can paginate results pub trait PaginatorTrait<'db, C> where C: ConnectionTrait<'db>, diff --git a/src/executor/select.rs b/src/executor/select.rs index 832096b7..1d72e9c2 100644 --- a/src/executor/select.rs +++ b/src/executor/select.rs @@ -31,7 +31,7 @@ where selector: S, } -/// Used to enforce constraints on any type that wants to perform SELECT queries +/// A Trait for any type that can perform SELECT queries pub trait SelectorTrait { #[allow(missing_docs)] type Item: Sized; diff --git a/src/query/traits.rs b/src/query/traits.rs index 0517cc64..cfc35350 100644 --- a/src/query/traits.rs +++ b/src/query/traits.rs @@ -1,7 +1,7 @@ use crate::{DbBackend, Statement}; use sea_query::QueryStatementBuilder; -/// Enforces a set of constraints to any type performing queries on a Model or ActiveModel +/// A Trait for any type performing queries on a Model or ActiveModel pub trait QueryTrait { /// Constrain the QueryStatement to [QueryStatementBuilder] trait type QueryStatement: QueryStatementBuilder;