Remove hook traits. There can only be one trait: Hook
This commit is contained in:
parent
be1ba5be4b
commit
37a505609e
7 changed files with 3 additions and 76 deletions
|
@ -1,13 +0,0 @@
|
|||
use storeid::StoreId;
|
||||
use store::FileLockEntry;
|
||||
use hook::accessor::HookDataAccessorProvider;
|
||||
use hook::result::HookResult;
|
||||
use hook::Hook;
|
||||
|
||||
pub trait PreCreateHook : Hook {
|
||||
fn pre_create(&self, &StoreId) -> HookResult<()>;
|
||||
}
|
||||
|
||||
pub trait PostCreateHook : Hook + HookDataAccessorProvider {
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
use storeid::StoreId;
|
||||
use store::FileLockEntry;
|
||||
use hook::accessor::HookDataAccessorProvider;
|
||||
use hook::result::HookResult;
|
||||
use hook::Hook;
|
||||
|
||||
pub trait PreDeleteHook : Hook {
|
||||
fn pre_delete(&self, &StoreId) -> HookResult<()>;
|
||||
}
|
||||
|
||||
pub trait PostDeleteHook : Hook {
|
||||
fn post_delete(&self, &StoreId) -> HookResult<()>;
|
||||
}
|
||||
|
|
@ -7,15 +7,12 @@ use store::FileLockEntry;
|
|||
|
||||
pub mod accessor;
|
||||
pub mod aspect;
|
||||
pub mod create;
|
||||
pub mod delete;
|
||||
pub mod error;
|
||||
pub mod read;
|
||||
pub mod result;
|
||||
pub mod retrieve;
|
||||
pub mod update;
|
||||
|
||||
pub trait Hook : Debug + Send + Sync {
|
||||
use hook::accessor::HookDataAccessorProvider;
|
||||
|
||||
pub trait Hook : HookDataAccessorProvider + Debug + Send + Sync {
|
||||
fn set_config(&mut self, cfg: Value);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
use storeid::StoreId;
|
||||
use store::FileLockEntry;
|
||||
use hook::accessor::HookDataAccessorProvider;
|
||||
use hook::result::HookResult;
|
||||
use hook::Hook;
|
||||
|
||||
pub trait PreReadHook : Hook {
|
||||
fn pre_read(&self, &StoreId) -> HookResult<()>;
|
||||
}
|
||||
|
||||
pub trait PostReadHook : Hook + HookDataAccessorProvider {
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
use storeid::StoreId;
|
||||
use store::FileLockEntry;
|
||||
use hook::accessor::HookDataAccessorProvider;
|
||||
use hook::result::HookResult;
|
||||
use hook::Hook;
|
||||
|
||||
pub trait PreRetrieveHook : Hook {
|
||||
fn pre_retrieve(&self, &StoreId) -> HookResult<()>;
|
||||
}
|
||||
|
||||
pub trait PostRetrieveHook : Hook + HookDataAccessorProvider {
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
use store::FileLockEntry;
|
||||
use hook::accessor::HookDataAccessorProvider;
|
||||
use hook::result::HookResult;
|
||||
use hook::Hook;
|
||||
|
||||
pub trait PreUpdateHook : Hook {
|
||||
fn pre_update(&self, &FileLockEntry) -> HookResult<()>;
|
||||
}
|
||||
|
||||
pub trait PostUpdateHook : Hook + HookDataAccessorProvider {
|
||||
}
|
||||
|
|
@ -28,11 +28,6 @@ use hook::accessor::{ MutableHookDataAccessor,
|
|||
NonMutableHookDataAccessor,
|
||||
HookDataAccessor,
|
||||
HookDataAccessorProvider};
|
||||
use hook::read::{PreReadHook, PostReadHook};
|
||||
use hook::create::{PreCreateHook, PostCreateHook};
|
||||
use hook::retrieve::{PreRetrieveHook, PostRetrieveHook};
|
||||
use hook::update::{PreUpdateHook, PostUpdateHook};
|
||||
use hook::delete::{PreDeleteHook, PostDeleteHook};
|
||||
|
||||
/// The Result Type returned by any interaction with the store that could fail
|
||||
pub type Result<T> = RResult<T, StoreError>;
|
||||
|
|
Loading…
Reference in a new issue