pub struct ServiceHooks<R, P> {
pub around_all: Vec<Arc<dyn DogAroundHook<R, P>>>,
pub before_all: Vec<Arc<dyn DogBeforeHook<R, P>>>,
pub after_all: Vec<Arc<dyn DogAfterHook<R, P>>>,
pub error_all: Vec<Arc<dyn DogErrorHook<R, P>>>,
pub around_by_method: HashMap<ServiceMethodKind, Vec<Arc<dyn DogAroundHook<R, P>>>>,
pub before_by_method: HashMap<ServiceMethodKind, Vec<Arc<dyn DogBeforeHook<R, P>>>>,
pub after_by_method: HashMap<ServiceMethodKind, Vec<Arc<dyn DogAfterHook<R, P>>>>,
pub error_by_method: HashMap<ServiceMethodKind, Vec<Arc<dyn DogErrorHook<R, P>>>>,
}Expand description
Feathers-style hooks container:
{ around: { all, create, find }, before: { all, create }, after: { all, find }, error: { all, create } }
Fields§
§around_all: Vec<Arc<dyn DogAroundHook<R, P>>>§before_all: Vec<Arc<dyn DogBeforeHook<R, P>>>§after_all: Vec<Arc<dyn DogAfterHook<R, P>>>§error_all: Vec<Arc<dyn DogErrorHook<R, P>>>§around_by_method: HashMap<ServiceMethodKind, Vec<Arc<dyn DogAroundHook<R, P>>>>§before_by_method: HashMap<ServiceMethodKind, Vec<Arc<dyn DogBeforeHook<R, P>>>>§after_by_method: HashMap<ServiceMethodKind, Vec<Arc<dyn DogAfterHook<R, P>>>>§error_by_method: HashMap<ServiceMethodKind, Vec<Arc<dyn DogErrorHook<R, P>>>>Implementations§
Source§impl<R, P> ServiceHooks<R, P>
impl<R, P> ServiceHooks<R, P>
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn around_all(&mut self, hook: Arc<dyn DogAroundHook<R, P>>) -> &mut Self
pub fn around( &mut self, method: ServiceMethodKind, hook: Arc<dyn DogAroundHook<R, P>>, ) -> &mut Self
pub fn before_all(&mut self, hook: Arc<dyn DogBeforeHook<R, P>>) -> &mut Self
pub fn before( &mut self, method: ServiceMethodKind, hook: Arc<dyn DogBeforeHook<R, P>>, ) -> &mut Self
pub fn before_create(&mut self, hook: Arc<dyn DogBeforeHook<R, P>>) -> &mut Self
pub fn before_find(&mut self, hook: Arc<dyn DogBeforeHook<R, P>>) -> &mut Self
pub fn before_get(&mut self, hook: Arc<dyn DogBeforeHook<R, P>>) -> &mut Self
pub fn before_update(&mut self, hook: Arc<dyn DogBeforeHook<R, P>>) -> &mut Self
pub fn before_patch(&mut self, hook: Arc<dyn DogBeforeHook<R, P>>) -> &mut Self
pub fn before_remove(&mut self, hook: Arc<dyn DogBeforeHook<R, P>>) -> &mut Self
pub fn after_all(&mut self, hook: Arc<dyn DogAfterHook<R, P>>) -> &mut Self
pub fn after( &mut self, method: ServiceMethodKind, hook: Arc<dyn DogAfterHook<R, P>>, ) -> &mut Self
pub fn after_create(&mut self, hook: Arc<dyn DogAfterHook<R, P>>) -> &mut Self
pub fn after_find(&mut self, hook: Arc<dyn DogAfterHook<R, P>>) -> &mut Self
pub fn error_all(&mut self, hook: Arc<dyn DogErrorHook<R, P>>) -> &mut Self
pub fn error( &mut self, method: ServiceMethodKind, hook: Arc<dyn DogErrorHook<R, P>>, ) -> &mut Self
Trait Implementations§
Source§impl<R, P> Default for ServiceHooks<R, P>
impl<R, P> Default for ServiceHooks<R, P>
Source§impl<R, P> SchemaHooksExt<R, P> for ServiceHooks<R, P>
impl<R, P> SchemaHooksExt<R, P> for ServiceHooks<R, P>
fn schema<F>(&mut self, f: F) -> &mut Selfwhere
F: FnOnce(&mut SchemaBuilder<'_, R, P>),
Auto Trait Implementations§
impl<R, P> Freeze for ServiceHooks<R, P>
impl<R, P> !RefUnwindSafe for ServiceHooks<R, P>
impl<R, P> Send for ServiceHooks<R, P>
impl<R, P> Sync for ServiceHooks<R, P>
impl<R, P> Unpin for ServiceHooks<R, P>
impl<R, P> !UnwindSafe for ServiceHooks<R, P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more