pub struct HookedService<S, H> {
pub inner: S,
pub hook: H,
}Expand description
A Service wrapper that applies a ServerHook around another service.
§Examples
use oms_modbus::*;
use std::sync::Arc;
let store = Arc::new(SlaveStore::new());
let hook = DummyHook;
let hooked = HookedService::new(store, hook);
// Pass `hooked` to any serve_forever() — it implements Service.Fields§
§inner: S§hook: HImplementations§
Source§impl<S, H> HookedService<S, H>
impl<S, H> HookedService<S, H>
Trait Implementations§
Source§impl<S: Clone, H: Clone> Clone for HookedService<S, H>
impl<S: Clone, H: Clone> Clone for HookedService<S, H>
Source§fn clone(&self) -> HookedService<S, H>
fn clone(&self) -> HookedService<S, H>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S, H> Service for HookedService<S, H>where
S: Service,
H: ServerHook,
impl<S, H> Service for HookedService<S, H>where
S: Service,
H: ServerHook,
Auto Trait Implementations§
impl<S, H> Freeze for HookedService<S, H>
impl<S, H> RefUnwindSafe for HookedService<S, H>where
S: RefUnwindSafe,
H: RefUnwindSafe,
impl<S, H> Send for HookedService<S, H>
impl<S, H> Sync for HookedService<S, H>
impl<S, H> Unpin for HookedService<S, H>
impl<S, H> UnsafeUnpin for HookedService<S, H>where
S: UnsafeUnpin,
H: UnsafeUnpin,
impl<S, H> UnwindSafe for HookedService<S, H>where
S: UnwindSafe,
H: UnwindSafe,
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