Trait ComponentType

Source
pub trait ComponentType:
    Into<u16>
    + From<u16>
    + FromStr
    + ToString
    + Send
    + Sync
    + Clone
    + Debug
    + Ord {
    type UpdateGraphIndex;
    type GlobalStatistics: Sync + DeserializeOwned + Serialize;

    // Required methods
    fn init_update_graph_index(
        _graph: &Graph<Self>,
    ) -> StdResult<Self::UpdateGraphIndex, ComponentTypeError>;
    fn all_component_types() -> Vec<Self>;
    fn calculate_global_statistics(
        graph: &mut Graph<Self>,
    ) -> StdResult<(), ComponentTypeError>;

    // Provided methods
    fn before_update_event(
        _update: &UpdateEvent,
        _graph: &Graph<Self>,
        _index: &mut Self::UpdateGraphIndex,
    ) -> StdResult<(), ComponentTypeError> { ... }
    fn after_update_event(
        _update: UpdateEvent,
        _graph: &Graph<Self>,
        _index: &mut Self::UpdateGraphIndex,
    ) -> StdResult<(), ComponentTypeError> { ... }
    fn apply_update_graph_index(
        _index: Self::UpdateGraphIndex,
        _graph: &mut Graph<Self>,
    ) -> StdResult<(), ComponentTypeError> { ... }
    fn default_components() -> Vec<Component<Self>> { ... }
    fn update_graph_index_components(
        _graph: &Graph<Self>,
    ) -> Vec<Component<Self>> { ... }
}

Required Associated Types§

Source

type UpdateGraphIndex

Source

type GlobalStatistics: Sync + DeserializeOwned + Serialize

Statistics that combine information for multiple graph components/and or annotations.

Required Methods§

Provided Methods§

Source

fn before_update_event( _update: &UpdateEvent, _graph: &Graph<Self>, _index: &mut Self::UpdateGraphIndex, ) -> StdResult<(), ComponentTypeError>

Source

fn after_update_event( _update: UpdateEvent, _graph: &Graph<Self>, _index: &mut Self::UpdateGraphIndex, ) -> StdResult<(), ComponentTypeError>

Source

fn apply_update_graph_index( _index: Self::UpdateGraphIndex, _graph: &mut Graph<Self>, ) -> StdResult<(), ComponentTypeError>

Source

fn default_components() -> Vec<Component<Self>>

Source

fn update_graph_index_components(_graph: &Graph<Self>) -> Vec<Component<Self>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§