From 6af5be15ad3198739e85994ddb235f1a87328be3 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 17 Feb 2016 16:15:11 +0100 Subject: [PATCH] Hooks must implement Debug --- libimagstore/src/hook.rs | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/libimagstore/src/hook.rs b/libimagstore/src/hook.rs index 3028cc98..c0b31f42 100644 --- a/libimagstore/src/hook.rs +++ b/libimagstore/src/hook.rs @@ -3,72 +3,82 @@ use self::error::HookError; pub type HookResult = Result; pub mod read { + use std::fmt::Debug; + use storeid::StoreId; use store::FileLockEntry; use super::HookResult; - pub trait PreReadHook { + pub trait PreReadHook : Debug { fn pre_read(&self, &StoreId) -> HookResult<()>; } - pub trait PostReadHook { + pub trait PostReadHook : Debug { fn post_read<'a>(&self, FileLockEntry<'a>) -> HookResult>; } } pub mod create { + use std::fmt::Debug; + use storeid::StoreId; use store::FileLockEntry; use super::HookResult; - pub trait PreCreateHook { + pub trait PreCreateHook : Debug { fn pre_create(&self, &StoreId) -> HookResult<()>; } - pub trait PostCreateHook { + pub trait PostCreateHook : Debug { fn post_create<'a>(&self, FileLockEntry<'a>) -> HookResult>; } } pub mod retrieve { + use std::fmt::Debug; + use storeid::StoreId; use store::FileLockEntry; use super::HookResult; - pub trait PreRetrieveHook { + pub trait PreRetrieveHook : Debug { fn pre_retrieve(&self, &StoreId) -> HookResult<()>; } - pub trait PostRetrieveHook { + pub trait PostRetrieveHook : Debug { fn post_retrieve<'a>(&self, FileLockEntry<'a>) -> HookResult>; } } pub mod update { + use std::fmt::Debug; + use store::FileLockEntry; use super::HookResult; - pub trait PreUpdateHook { + pub trait PreUpdateHook : Debug { fn pre_update(&self, &FileLockEntry) -> HookResult<()>; } - pub trait PostUpdateHook { + pub trait PostUpdateHook : Debug { fn post_update(&self, &FileLockEntry) -> HookResult<()>; } } pub mod delete { + use std::fmt::Debug; + use storeid::StoreId; use store::FileLockEntry; use super::HookResult; - pub trait PreDeleteHook { + pub trait PreDeleteHook : Debug { fn pre_delete(&self, &StoreId) -> HookResult<()>; } - pub trait PostDeleteHook { + pub trait PostDeleteHook : Debug { fn post_delete(&self, &StoreId) -> HookResult<()>; } }