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§
type UpdateGraphIndex
Sourcetype GlobalStatistics: Sync + DeserializeOwned + Serialize
type GlobalStatistics: Sync + DeserializeOwned + Serialize
Statistics that combine information for multiple graph components/and or annotations.
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>>
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.