pub struct Relation {
pub name: String,
pub from_type: String,
pub from_field: String,
pub to_type: String,
pub to_field: String,
pub kind: RelationKind,
}Expand description
关联关系定义
描述两个 GraphQL 类型之间的关联关系
Fields§
§name: String关联名称
from_type: String源类型名
from_field: String源类型关联字段(外键)
to_type: String目标类型名
to_field: String目标类型关联字段(主键)
kind: RelationKind关联类型
Implementations§
Source§impl Relation
impl Relation
pub fn new( name: impl Into<String>, from_type: impl Into<String>, from_field: impl Into<String>, to_type: impl Into<String>, to_field: impl Into<String>, kind: RelationKind, ) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Relation
impl<'de> Deserialize<'de> for Relation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Relation
impl RefUnwindSafe for Relation
impl Send for Relation
impl Sync for Relation
impl Unpin for Relation
impl UnsafeUnpin for Relation
impl UnwindSafe for Relation
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