pub trait IncidenceWeight: IncidenceBase {
type Weight: Copy;
// Required method
fn incidence_weight(&self, incidence: Self::IncidenceId) -> Self::Weight;
}Expand description
Optional total weight capability for topology incidences.
A view implements this trait only when every visible incidence has a weight representation. The topology layer does not interpret the value; algorithms define their own numeric contracts separately.
§Performance
Lookup should be O(1) unless an implementation documents a weaker
contract.
Required Associated Types§
Required Methods§
Sourcefn incidence_weight(&self, incidence: Self::IncidenceId) -> Self::Weight
fn incidence_weight(&self, incidence: Self::IncidenceId) -> Self::Weight
Returns the weight attached to incidence.
§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".