pub struct EntitiesRelation<'a, D> { /* private fields */ }Expand description
Implementations§
Source§impl<'a, D> EntitiesRelation<'a, D>
Implementation of the EntitiesRelation struct.
EntitiesRelation结构体关系的实现。
impl<'a, D> EntitiesRelation<'a, D>
Implementation of the EntitiesRelation struct. EntitiesRelation结构体关系的实现。
Sourcepub fn validate(&self, values: Vec<&'a D>) -> Result<(), Error>
pub fn validate(&self, values: Vec<&'a D>) -> Result<(), Error>
Sourcepub fn one_to_one(primary_key: &'a D) -> Self
pub fn one_to_one(primary_key: &'a D) -> Self
Creates a new EntitiesRelation instance for one-to-one relations.
This relation type allows a single entity to be associated with another single entity.
§Arguments
primary_key- The primary key of the entity
§Returns
A new EntitiesRelation instance with OneToOne relationship type
创建一对一关系的EntitiesRelation实例。
此关系类型允许单个实体与另一个单个实体关联。
§参数
primary_key- 实体的主键
§返回值
具有一对一关系类型的新EntitiesRelation实例
Sourcepub fn one_to_many(primary_key: &'a D) -> Self
pub fn one_to_many(primary_key: &'a D) -> Self
Creates a new EntitiesRelation instance for one-to-many relations.
This relation type allows one entity to be associated with multiple other entities.
§Arguments
primary_key- The primary key of the entity
§Returns
A new EntitiesRelation instance with OneToMany relationship type
创建一对多关系的EntitiesRelation实例。
此关系类型允许一个实体与多个其他实体关联。
§参数
primary_key- 实体的主键
§返回值
具有一对多关系类型的新EntitiesRelation实例
Sourcepub fn many_to_many(primary_key: &'a D) -> Self
pub fn many_to_many(primary_key: &'a D) -> Self
Creates a new EntitiesRelation instance for many-to-many relations.
This relation type allows multiple entities to be associated with multiple other entities.
§Arguments
primary_key- The primary key of the entity
§Returns
A new EntitiesRelation instance with ManyToMany relationship type
创建多对多关系的EntitiesRelation实例。
此关系类型允许多个实体与多个其他实体关联。
§参数
primary_key- 实体的主键
§返回值
具有多对多关系类型的新EntitiesRelation实例
Auto Trait Implementations§
impl<'a, D> Freeze for EntitiesRelation<'a, D>
impl<'a, D> RefUnwindSafe for EntitiesRelation<'a, D>where
D: RefUnwindSafe,
impl<'a, D> Send for EntitiesRelation<'a, D>where
D: Sync,
impl<'a, D> Sync for EntitiesRelation<'a, D>where
D: Sync,
impl<'a, D> Unpin for EntitiesRelation<'a, D>
impl<'a, D> UnwindSafe for EntitiesRelation<'a, D>where
D: RefUnwindSafe,
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
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>
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>
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