Skip to main content

IncidenceWeight

Trait IncidenceWeight 

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

Source

type Weight: Copy

Copyable weight representation attached to each visible incidence.

§Performance

Values should be O(1) to copy.

Required Methods§

Source

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

Implementors§