Skip to main content

RelationIncidences

Trait RelationIncidences 

Source
pub trait RelationIncidences: IncidenceBase {
    type Incidences<'view>: Iterator<Item = Self::IncidenceId>
       where Self: 'view;

    // Required method
    fn relation_incidences(
        &self,
        relation: Self::RelationId,
    ) -> Self::Incidences<'_>;
}
Expand description

Capability for traversing incidences attached to a relation.

The generic associated iterator type lets each backend return its own concrete iterator without allocating or using dynamic dispatch.

§Performance

Creating the iterator should be O(1) unless an implementation documents a weaker contract. Yielding k incidences should be O(k) because the output itself has length k.

Required Associated Types§

Source

type Incidences<'view>: Iterator<Item = Self::IncidenceId> where Self: 'view

Iterator over incidence IDs for one relation.

§Performance

Advancing the iterator should be amortized O(1) unless an implementation documents otherwise.

Required Methods§

Source

fn relation_incidences( &self, relation: Self::RelationId, ) -> Self::Incidences<'_>

Returns incidences attached to relation.

§Performance

Expected O(1) to create the iterator; yielding k incidences is expected O(k).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§