pub trait RequestFilter:
Send
+ Sync
+ Debug
+ DynClone {
// Required method
fn allow_request(
&self,
request: &RequestSpecific,
from: SocketAddrV4,
) -> bool;
}Expand description
A trait for filtering incoming requests to a DHT node and decide whether to allow handling it or rate limit or ban the requester, or prohibit specific requests’ details.
Required Methods§
Sourcefn allow_request(&self, request: &RequestSpecific, from: SocketAddrV4) -> bool
fn allow_request(&self, request: &RequestSpecific, from: SocketAddrV4) -> bool
Returns true if the request from this source is allowed.