Remove hook traits. There can only be one trait: Hook

This commit is contained in:
Matthias Beyer 2016-03-04 19:19:54 +01:00
parent be1ba5be4b
commit 37a505609e
7 changed files with 3 additions and 76 deletions

View file

@ -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 {
}

View file

@ -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<()>;
}

View file

@ -7,15 +7,12 @@ use store::FileLockEntry;
pub mod accessor; pub mod accessor;
pub mod aspect; pub mod aspect;
pub mod create;
pub mod delete;
pub mod error; pub mod error;
pub mod read;
pub mod result; 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); fn set_config(&mut self, cfg: Value);
} }

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -28,11 +28,6 @@ use hook::accessor::{ MutableHookDataAccessor,
NonMutableHookDataAccessor, NonMutableHookDataAccessor,
HookDataAccessor, HookDataAccessor,
HookDataAccessorProvider}; 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 /// The Result Type returned by any interaction with the store that could fail
pub type Result<T> = RResult<T, StoreError>; pub type Result<T> = RResult<T, StoreError>;