Skip to main content

find_back_relationship

Function find_back_relationship 

Source
pub fn find_back_relationship(
    source_rel: &RelationshipInfo,
    target_relationships: &'static [RelationshipInfo],
) -> Option<&'static RelationshipInfo>
Expand description

Find the back-relationship from a target model back to the source.

Given Hero::team with back_populates = "heroes", this finds Team::heroes which should have back_populates = "team".

ยงArguments

  • source_rel - The relationship on the source model
  • target_relationships - The RELATIONSHIPS slice from the target model