Skip to main content

RelationWeight

Trait RelationWeight 

Source
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§

Source

type Weight: Copy

Copyable weight representation attached to each visible relation.

§Performance

Values should be O(1) to copy.

Required Methods§

Source

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".

Implementors§