pub trait RelationWeight: TopologyBase {
type Weight: Copy;
// Required method
fn relation_weight(&self, relation: Self::RelationId) -> Self::Weight;
}Expand description
Optional total weight capability for topology relations.
A view implements this trait only when every visible relation has a weight representation. The topology layer does not interpret the value; algorithms define any finite, non-negative, additive, ordered, or normalization requirements separately.
§Performance
Lookup should be O(1) unless an implementation documents a weaker
contract.
Required Associated Types§
Required Methods§
Sourcefn relation_weight(&self, relation: Self::RelationId) -> Self::Weight
fn relation_weight(&self, relation: Self::RelationId) -> Self::Weight
Returns the weight attached to relation.
§Performance
Expected O(1) unless the implementation documents otherwise.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".