7c276d541d
Merge pull request #279 from matthiasbeyer/libimagstore/rewrite-file
...
Truncate file to zero size before writing new content, so we do not p…
2016-03-26 13:56:06 +01:00
0a181479c8
Merge pull request #277 from matthiasbeyer/libimagstore/remove-unused-aspects
...
Libimagstore/remove unused aspects
2016-03-26 13:55:46 +01:00
93d7b81dc5
Merge pull request #276 from matthiasbeyer/libimagstore/config-getter
...
Store::config() added, mainly for debugging use
2016-03-26 13:55:11 +01:00
ad35d0bf50
Add missing hook_error_type_as_str() impl
2016-03-25 19:17:35 +01:00
bb918db5c3
Fix wrong hook execution: post-retrieve
2016-03-25 19:17:19 +01:00
b54576d95d
Add README for libimagstore
2016-03-25 15:56:42 +01:00
ab417a17d0
Truncate file to zero size before writing new content, so we do not partially write the file
2016-03-25 15:39:26 +01:00
Kai Sickeler
cdbc0ceae5
Removed unused functions
2016-03-25 15:22:45 +01:00
Kai Sickeler
797a707c8e
removed unused Pre- / PostRead aspects
2016-03-25 15:22:45 +01:00
ad18091b88
Store::config() added, mainly for debugging use
2016-03-25 15:15:37 +01:00
c5c60cf36d
impl Debug for Store
2016-03-25 13:30:26 +01:00
22052ba9f0
Add some more error types to be more specific about what happened
2016-03-25 13:30:16 +01:00
a96ca837c6
Make HookPosition clonable
2016-03-24 17:57:19 +01:00
2deb98d764
Add deny() so we turn some warnings into errors
2016-03-22 19:44:04 +01:00
c59ed7d2fe
Use unused result when file.write_all() and return error
2016-03-22 19:44:04 +01:00
dc7a212278
Use unused result which must be used when file.seek()ing
2016-03-22 19:44:04 +01:00
a45571e299
Remove unused function AspectConfig::config()
2016-03-22 19:44:04 +01:00
8e852384bd
Remove unused function from Store
2016-03-22 19:44:04 +01:00
a9eddb088a
Remove unused functions from LazyFile
...
- Remove uses of LazyFile::new() from tests
- Use LazyFile::get_file_mut() in test as we want the file mut anyways
2016-03-22 19:43:48 +01:00
af161394ad
Remove dead code in configuration.rs
2016-03-22 19:43:48 +01:00
a4c820d308
Remove unused keyword "mut"
2016-03-22 19:43:48 +01:00
8aa3f31970
Remove unused variables
2016-03-22 19:43:48 +01:00
2fb59b3ae6
Remove unused imports
2016-03-22 19:43:48 +01:00
041a2a4942
Add encoding error if typeconversion fails
2016-03-19 15:15:04 +01:00
fe0849f8eb
Add implementation for Store::retrieve_for_module()
2016-03-19 15:15:04 +01:00
80945fcd16
Rewrite build_entry_path() so it does not panic!() anymore
2016-03-19 14:48:09 +01:00
b8b49b3240
Move: build_entry_path() from imag-store to libimagstore
2016-03-19 14:47:45 +01:00
65a64774b6
Fix: Allow NonMutableAccess in MutableHookDataAcessor
2016-03-16 16:46:54 +01:00
feac9ae9e8
Store::new(): Aspect configuration added
2016-03-16 16:46:54 +01:00
96deb17515
Aspect: Optionally get configuration
2016-03-16 16:46:54 +01:00
f1246093f1
Implement AspectConfig::get_for()
2016-03-16 16:46:54 +01:00
08b36972f1
Make store configuration optional
2016-03-16 16:46:54 +01:00
0286d8a25e
Store: Add hook configuration on registration
2016-03-16 16:46:54 +01:00
59fdb7ef3d
Store: Get configuration object not as reference, to avoid livetimes
2016-03-16 16:46:54 +01:00
6dae03d731
Hook: Must provide name, gets reference to configuration
2016-03-16 16:46:54 +01:00
9961f64ce6
Add AspectConfig type
2016-03-16 16:46:53 +01:00
c942c74f05
Implement getter for aspect names
2016-03-16 16:46:53 +01:00
d249f604d8
Implement: config_is_valid()
2016-03-16 16:46:53 +01:00
cd55e7d625
Add Aspect building based on configuration
2016-03-16 16:46:53 +01:00
1fe545eb8b
Add configuration.rs
2016-03-16 16:46:53 +01:00
a771db9ea4
Add error kind for config errors
2016-03-16 16:46:53 +01:00
9e8ef57f72
Remove {Pre, Post}HookErrorKind types as they are not needed anymore
2016-03-16 16:46:53 +01:00
987b271cc7
Add access type checking error
2016-03-16 16:46:53 +01:00
5ba260943b
Make hook execution parallel for NonMutableHookDataAccessor impl for Aspect
2016-03-16 16:46:53 +01:00
7102a57808
Make hook execution parallel for StoreIdAccessor impl for Aspect
2016-03-16 16:46:53 +01:00
d8760c9737
Impl NonMutableHookDataAccessor::access() for Aspect
2016-03-16 16:46:53 +01:00
c4c02f2274
Impl MutableHookDataAccessor::access_mut() for Aspect
2016-03-16 16:46:53 +01:00
2022f4e4bb
Impl StoreIdAccessor::access() for Aspect
2016-03-16 16:46:53 +01:00
2c544382a1
We do not need boxes here
2016-03-16 16:46:53 +01:00
679865464b
Reimplement hook registration and execution
2016-03-16 16:46:52 +01:00
d6a581e69f
Add HookPosition enum
2016-03-16 16:46:52 +01:00
37a505609e
Remove hook traits. There can only be one trait: Hook
2016-03-16 16:46:52 +01:00
be1ba5be4b
Add Aspect type for hook system
2016-03-16 16:46:52 +01:00
3e62b71605
Add StoreIdAccessor trait
2016-03-16 16:46:52 +01:00
fa9e8e8192
Split hook/mod.rs into several files
2016-03-16 16:46:52 +01:00
3f15fd0fa8
Move hook.rs -> hook/mod.rs
2016-03-16 16:46:52 +01:00
a9600f23b3
Threaded hook execution
2016-03-16 16:46:52 +01:00
79ba3f5151
Hook calling rewrite
2016-03-16 16:46:52 +01:00
0610f0756a
Add dep: crossbeam = 0.2.8
2016-03-16 16:46:52 +01:00
3421e8d4d9
Add HookExecutionError error kind
2016-03-16 16:46:52 +01:00
1c40be78a9
Add HookAccessor types for accessing mutable/nonmutable hook calling in a generic way
2016-03-16 16:46:52 +01:00
e1414beb8d
Impl Into<HookError> for error kinds to convert errors in a simple way
2016-03-16 16:46:51 +01:00
57831dceb0
Add HookErrorKind enums for Pre and Post errors
2016-03-16 16:46:51 +01:00
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
d9a4512821
Add debug output for hook exec functions
2016-03-16 16:46:51 +01:00
da3554d98e
Add debug output for hook register functions
2016-03-16 16:46:51 +01:00
6af5be15ad
Hooks must implement Debug
2016-03-16 16:46:51 +01:00
bb0e7e2468
Implement: execute_post_delete_hooks()
2016-03-16 16:46:51 +01:00
f703e8a4cd
Implement: execute_post_update_hooks()
2016-03-16 16:46:51 +01:00
7014256407
Implement: execute_post_retrieve_hooks()
2016-03-16 16:46:51 +01:00
5831d3bc7b
Implement: execute_post_create_hooks()
2016-03-16 16:46:51 +01:00
196be30d91
Implement: execute_post_read_hooks()
2016-03-16 16:46:51 +01:00
09acddaef9
Implement: execute_pre_delete_hooks()
2016-03-16 16:46:51 +01:00
5aa663987b
Implement: execute_pre_update_hooks()
2016-03-16 16:46:51 +01:00
94128f8bcc
Implement: execute_pre_retrieve_hooks()
2016-03-16 16:46:50 +01:00
3244b87c7e
Implement: execute_pre_create_hooks()
2016-03-16 16:46:50 +01:00
975a2bc8b9
Implement: execute_pre_read_hooks()
2016-03-16 16:46:50 +01:00
ac280ba616
Insert pre/post hook execution functions
2016-03-16 16:46:50 +01:00
3cf2588104
Add error types for pre/post hooks
2016-03-16 16:39:39 +01:00
17b1d6c390
Redefine hook trait system
2016-03-16 16:39:39 +01:00
001c80b72d
Hook: Add traits which must be implemented for Hook
2016-03-16 16:39:39 +01:00
b9127381b8
Add hook registering
2016-03-16 16:39:39 +01:00
d99d25a3e1
Add HookRegisterError kind
2016-03-16 16:39:14 +01:00
e969b8678e
Add hook traits
2016-03-16 16:39:14 +01:00
361dec4cec
Revert "Check whether the StoreId is inside the store, before doing anything on the FS"
...
This reverts commit 373502217e
.
2016-03-12 16:06:10 +01:00
9a918c9252
Merge pull request #242 from matthiasbeyer/libimagstore/revert-id_in_store-check
...
Revert "Check whether the StoreId is inside the store, before doing a…
2016-03-11 16:02:11 +01:00
6d7065d10e
Fix test: StoreId does not start with "/" anymore
2016-03-10 19:12:00 +01:00
a9a64d4ab6
Fix: implicitely create directories on file saving
2016-03-10 19:06:27 +01:00
a3a09ff4ee
Fix store creation of libimagstore
...
The macro may not prefix the StoreId internal PathBuf with '/', so this
path is not absolute. This way we can introduce `storify_id()` which
creates a proper PathBuf into the store out of our StoreId object.
Does not yet do verification whether the path is inside the store,
actually.
2016-03-10 18:46:26 +01:00
3413646934
Revert "Check whether the StoreId is inside the store, before doing anything on the FS"
...
This reverts commit 373502217e
as this commit was introducing a bug.
The StoreId type says `/test/example` for a store id path, which is
completely valid, as the root (`/`) is the store itself. The
id_in_store() function assumed that the store-id is the full
(file-system) path to the store entry, which is false.
This commit does not introduce a fix but revert the check.
2016-03-10 18:14:53 +01:00
df1fd31771
libimagstore: Update glob 0.2.10 -> 0.2.11
2016-03-07 17:46:58 +01:00
257fe1880e
EntryHeader: Function to get toml object
2016-03-06 11:51:09 +01:00
74634227e0
Use unused result
2016-03-01 21:23:09 +01:00
22e9f8a93b
Remove unused import
2016-03-01 21:21:14 +01:00
1a8106dfd2
Add missing error-forwarding
2016-03-01 21:20:53 +01:00
38b9e15615
Remove unreachable statement
2016-03-01 21:19:15 +01:00
08c37c5fcb
Remove unused "mut" from EntryHeader::delete()
2016-03-01 21:18:17 +01:00
ed3da38701
Remove unused "mut" from EntryHeader::read_with_sep()
2016-03-01 21:18:10 +01:00
309e70df14
Remove unused "mut" from EntryHeader::set_with_sep()
2016-03-01 21:18:04 +01:00
85e69f083e
Remove unused "mut" from EntryHeader::insert_with_sep()
2016-03-01 21:17:49 +01:00