pub struct AllowListDispatcher<D>where
D: Dispatcher,{
pub inner: D,
pub method_allowlist: Option<HashSet<String>>,
}
Expand description
Dispatcher that only allows specified methods.
Fields§
§inner: D
The underlying dispatcher.
method_allowlist: Option<HashSet<String>>
Allowed methods. If None
, all methods are allowed.
Implementations§
Source§impl<D> AllowListDispatcher<D>where
D: Dispatcher,
impl<D> AllowListDispatcher<D>where
D: Dispatcher,
Trait Implementations§
Source§impl<D> Dispatcher for AllowListDispatcher<D>where
D: Dispatcher,
impl<D> Dispatcher for AllowListDispatcher<D>where
D: Dispatcher,
Source§fn dispatch<'life0, 'life1, 'async_trait>(
&'life0 mut self,
request: Request,
tx: Option<&'life1 Sender<Message>>,
id: u64,
frame_type: Option<FrameType>,
) -> Pin<Box<dyn Future<Output = Option<ResponseAndSubScriptionNotifier>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dispatch<'life0, 'life1, 'async_trait>(
&'life0 mut self,
request: Request,
tx: Option<&'life1 Sender<Message>>,
id: u64,
frame_type: Option<FrameType>,
) -> Pin<Box<dyn Future<Output = Option<ResponseAndSubScriptionNotifier>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calls the requested method with the request parameters and returns it’s return value (or error) as a response.
Source§fn match_method(&self, name: &str) -> bool
fn match_method(&self, name: &str) -> bool
Returns whether a method should be dispatched with this dispatcher. Read more
Source§fn method_names(&self) -> Vec<&str>
fn method_names(&self) -> Vec<&str>
Returns the names of all methods matched by this dispatcher.
Auto Trait Implementations§
impl<D> Freeze for AllowListDispatcher<D>where
D: Freeze,
impl<D> RefUnwindSafe for AllowListDispatcher<D>where
D: RefUnwindSafe,
impl<D> Send for AllowListDispatcher<D>
impl<D> Sync for AllowListDispatcher<D>
impl<D> Unpin for AllowListDispatcher<D>where
D: Unpin,
impl<D> UnwindSafe for AllowListDispatcher<D>where
D: 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