use crate::ModelDescriptor;
pub struct RelationInclude<M: 'static, Rel: 'static, RelPK: 'static> {
pub parent_fk_extract: fn(&M) -> Option<RelPK>,
pub related_descriptor: &'static ModelDescriptor<Rel, RelPK>,
}
impl<M, Rel, RelPK> Copy for RelationInclude<M, Rel, RelPK> {}
impl<M, Rel, RelPK> Clone for RelationInclude<M, Rel, RelPK> {
fn clone(&self) -> Self {
*self
}
}
impl<M, Rel, RelPK> std::fmt::Debug for RelationInclude<M, Rel, RelPK> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("RelationInclude")
.field("related_table", &self.related_descriptor.table_name)
.field("related_primary_key", &self.related_descriptor.primary_key)
.finish()
}
}