Make `NullRequestFilterExecutor` unconstructable.
This type is only intended to be used for type-level programming, and
thus making it unconstructable helps defend against possible future
misuse, which could otherwise result in unexpected thread panics.
@@ -9,7 +9,12 @@ pub trait RequestFilterExecutor {
/// A "null" request filter executor, which does nothing, but permits
/// bypassing of typechecking issues where no filter should be applied.
-pub struct NullRequestFilterExecutor;
+pub struct NullRequestFilterExecutor {
+ // This field is added (and is private) to guarantee that this struct
+ // is never instantiated accidentally, and is instead only able to be
+ // used for type-level programming.
+ _private_field: (),
+}
impl RequestFilterExecutor for NullRequestFilterExecutor {
fn call(&self, request: &Request) -> Request {
