Trait graphannis_core::types::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§

Object Safety§

This trait is not object safe.

Implementors§