Commit Graph

1501 Commits

Author SHA1 Message Date
Matthias Beyer 96deb17515 Aspect: Optionally get configuration 2016-03-16 16:46:54 +01:00
Matthias Beyer f1246093f1 Implement AspectConfig::get_for() 2016-03-16 16:46:54 +01:00
Matthias Beyer 08b36972f1 Make store configuration optional 2016-03-16 16:46:54 +01:00
Matthias Beyer 0286d8a25e Store: Add hook configuration on registration 2016-03-16 16:46:54 +01:00
Matthias Beyer 59fdb7ef3d Store: Get configuration object not as reference, to avoid livetimes 2016-03-16 16:46:54 +01:00
Matthias Beyer 6dae03d731 Hook: Must provide name, gets reference to configuration 2016-03-16 16:46:54 +01:00
Matthias Beyer 9961f64ce6 Add AspectConfig type 2016-03-16 16:46:53 +01:00
Matthias Beyer c942c74f05 Implement getter for aspect names 2016-03-16 16:46:53 +01:00
Matthias Beyer d249f604d8 Implement: config_is_valid() 2016-03-16 16:46:53 +01:00
Matthias Beyer cd55e7d625 Add Aspect building based on configuration 2016-03-16 16:46:53 +01:00
Matthias Beyer 1fe545eb8b Add configuration.rs 2016-03-16 16:46:53 +01:00
Matthias Beyer a771db9ea4 Add error kind for config errors 2016-03-16 16:46:53 +01:00
Matthias Beyer 9e8ef57f72 Remove {Pre, Post}HookErrorKind types as they are not needed anymore 2016-03-16 16:46:53 +01:00
Matthias Beyer 987b271cc7 Add access type checking error 2016-03-16 16:46:53 +01:00
Matthias Beyer 5ba260943b Make hook execution parallel for NonMutableHookDataAccessor impl for Aspect 2016-03-16 16:46:53 +01:00
Matthias Beyer 7102a57808 Make hook execution parallel for StoreIdAccessor impl for Aspect 2016-03-16 16:46:53 +01:00
Matthias Beyer d8760c9737 Impl NonMutableHookDataAccessor::access() for Aspect 2016-03-16 16:46:53 +01:00
Matthias Beyer c4c02f2274 Impl MutableHookDataAccessor::access_mut() for Aspect 2016-03-16 16:46:53 +01:00
Matthias Beyer 2022f4e4bb Impl StoreIdAccessor::access() for Aspect 2016-03-16 16:46:53 +01:00
Matthias Beyer 2c544382a1 We do not need boxes here 2016-03-16 16:46:53 +01:00
Matthias Beyer 679865464b Reimplement hook registration and execution 2016-03-16 16:46:52 +01:00
Matthias Beyer d6a581e69f Add HookPosition enum 2016-03-16 16:46:52 +01:00
Matthias Beyer 37a505609e Remove hook traits. There can only be one trait: Hook 2016-03-16 16:46:52 +01:00
Matthias Beyer be1ba5be4b Add Aspect type for hook system 2016-03-16 16:46:52 +01:00
Matthias Beyer 3e62b71605 Add StoreIdAccessor trait 2016-03-16 16:46:52 +01:00
Matthias Beyer fa9e8e8192 Split hook/mod.rs into several files 2016-03-16 16:46:52 +01:00
Matthias Beyer 3f15fd0fa8 Move hook.rs -> hook/mod.rs 2016-03-16 16:46:52 +01:00
Matthias Beyer 4dc1140149 doc: Add hook aspect definition 2016-03-16 16:46:52 +01:00
Matthias Beyer a9600f23b3 Threaded hook execution 2016-03-16 16:46:52 +01:00
Matthias Beyer 79ba3f5151 Hook calling rewrite 2016-03-16 16:46:52 +01:00
Matthias Beyer 0610f0756a Add dep: crossbeam = 0.2.8 2016-03-16 16:46:52 +01:00
Matthias Beyer 3421e8d4d9 Add HookExecutionError error kind 2016-03-16 16:46:52 +01:00
Matthias Beyer 1c40be78a9 Add HookAccessor types for accessing mutable/nonmutable hook calling in a generic way 2016-03-16 16:46:52 +01:00
Matthias Beyer c9bca51273 doc: Add documentation for the Hook system 2016-03-16 16:46:51 +01:00
Matthias Beyer e1414beb8d Impl Into<HookError> for error kinds to convert errors in a simple way 2016-03-16 16:46:51 +01:00
Matthias Beyer 57831dceb0 Add HookErrorKind enums for Pre and Post errors 2016-03-16 16:46:51 +01:00
Matthias Beyer d7733aa13a Make hooks configurable
This introduces the Configurable trait and abstracts the
dependency-traits for each trait over a generic "Hook" trait, which
requires Configurable and Debug to be implemented, but has no own
functions.

Configuring is done _without_ the Runtime object, so we can be sure that
the hooks do not have access to the store object.
2016-03-16 16:46:51 +01:00
Matthias Beyer d9a4512821 Add debug output for hook exec functions 2016-03-16 16:46:51 +01:00
Matthias Beyer da3554d98e Add debug output for hook register functions 2016-03-16 16:46:51 +01:00
Matthias Beyer 6af5be15ad Hooks must implement Debug 2016-03-16 16:46:51 +01:00
Matthias Beyer bb0e7e2468 Implement: execute_post_delete_hooks() 2016-03-16 16:46:51 +01:00
Matthias Beyer f703e8a4cd Implement: execute_post_update_hooks() 2016-03-16 16:46:51 +01:00
Matthias Beyer 7014256407 Implement: execute_post_retrieve_hooks() 2016-03-16 16:46:51 +01:00
Matthias Beyer 5831d3bc7b Implement: execute_post_create_hooks() 2016-03-16 16:46:51 +01:00
Matthias Beyer 196be30d91 Implement: execute_post_read_hooks() 2016-03-16 16:46:51 +01:00
Matthias Beyer 09acddaef9 Implement: execute_pre_delete_hooks() 2016-03-16 16:46:51 +01:00
Matthias Beyer 5aa663987b Implement: execute_pre_update_hooks() 2016-03-16 16:46:51 +01:00
Matthias Beyer 94128f8bcc Implement: execute_pre_retrieve_hooks() 2016-03-16 16:46:50 +01:00
Matthias Beyer 3244b87c7e Implement: execute_pre_create_hooks() 2016-03-16 16:46:50 +01:00
Matthias Beyer 975a2bc8b9 Implement: execute_pre_read_hooks() 2016-03-16 16:46:50 +01:00