fn create_filter<REv: ReactorEventT>(
        effect_builder: EffectBuilder<REv>,
        api_version: ProtocolVersion,
    ) -> BoxedFilter<(Response<Body>,)> {
        let with_params = warp::path(RPC_API_PATH)
            .and(filters::json_rpc())
            .and(filters::method(Self::METHOD))
            .and(filters::params::<Self::OptionalRequestParams>())
            .and_then(
                move |response_builder: Builder, params: Self::OptionalRequestParams| {
                    Self::handle_request(
                        effect_builder,
                        response_builder,
                        Some(params),
                        api_version,
                    )
                    .map_err(reject::custom)
                },
            );
        let with_invalid_params = warp::path(RPC_API_PATH)
            .and(filters::json_rpc())
            .and(filters::method(Self::METHOD))
            .and(filters::params::<Value>())
            .and_then(
                move |response_builder: Builder, _params: Value| async move {
                    response_builder
                        .error(warp_json_rpc::Error::INVALID_PARAMS)
                        .map_err(|_| reject::reject())
                },
            );
        let without_params = warp::path(RPC_API_PATH)
            .and(filters::json_rpc())
            .and(filters::method(Self::METHOD))
            .and_then(move |response_builder: Builder| {
                Self::handle_request(effect_builder, response_builder, None, api_version)
                    .map_err(reject::custom)
            });
        with_params
            .or(without_params)
            .unify()
            .or(with_invalid_params)
            .unify()
            .boxed()
    }
/// Creates the warp filter for this particular RPC.
Creates the warp filter for this particular RPC.
Creates the warp filter for this particular RPC .
fn create_filter<REv: ReactorEventT>(
        effect_builder: EffectBuilder<REv>,
        api_version: ProtocolVersion,
    ) -> BoxedFilter<(Response<Body>,)> {
        let with_params = warp::path(RPC_API_PATH)
            .and(filters::json_rpc())
            .and(filters::method(Self::METHOD))
            .and(filters::params::<Self::OptionalRequestParams>())
            .and_then(
                move |response_builder: Builder, params: Self::OptionalRequestParams| {
                    Self::handle_request(
                        effect_builder,
                        response_builder,
                        Some(params),
                        api_version,
                    )
                    .map_err(reject::custom)
                },
            );
        let with_invalid_params = warp::path(RPC_API_PATH)
            .and(filters::json_rpc())
            .and(filters::method(Self::METHOD))
            .and(filters::params::<Value>())
            .and_then(
                move |response_builder: Builder, _params: Value| async move {
                    response_builder
                        .error(warp_json_rpc::Error::INVALID_PARAMS)
                        .map_err(|_| reject::reject())
                },
            );
        let without_params = warp::path(RPC_API_PATH)
            .and(filters::json_rpc())
            .and(filters::method(Self::METHOD))
            .and_then(move |response_builder: Builder| {
                Self::handle_request(effect_builder, response_builder, None, api_version)
                    .map_err(reject::custom)
            });
        with_params
            .or(without_params)
            .unify()
            .or(with_invalid_params)
            .unify()
            .boxed()
    }
fn create_filter < REv : ReactorEventT > ( effect_builder : EffectBuilder < REv > , api_version : ProtocolVersion , ) -> BoxedFilter < ( Response < Body > , ) > { let with_params = warp :: path ( RPC_API_PATH ) . and ( filters :: json_rpc ( ) ) . and ( filters :: method ( Self :: METHOD ) ) . and ( filters :: params :: < Self :: OptionalRequestParams > ( ) ) . and_then ( move | response_builder : Builder , params : Self :: OptionalRequestParams | { Self :: handle_request ( effect_builder , response_builder , Some ( params ) , api_version , ) . map_err ( reject :: custom ) } , ) ; let with_invalid_params = warp :: path ( RPC_API_PATH ) . and ( filters :: json_rpc ( ) ) . and ( filters :: method ( Self :: METHOD ) ) . and ( filters :: params :: < Value > ( ) ) . and_then ( move | response_builder : Builder , _params : Value | async move { response_builder . error ( warp_json_rpc :: Error :: INVALID_PARAMS ) . map_err ( | _ | reject :: reject ( ) ) } , ) ; let without_params = warp :: path ( RPC_API_PATH ) . and ( filters :: json_rpc ( ) ) . and ( filters :: method ( Self :: METHOD ) ) . and_then ( move | response_builder : Builder | { Self :: handle_request ( effect_builder , response_builder , None , api_version ) . map_err ( reject :: custom ) } ) ; with_params . or ( without_params ) . unify ( ) . or ( with_invalid_params ) . unify ( ) . boxed ( ) }
Creates the warp filter for this particular RPC.
Creates the warp filter for this particular RPC .
effect_builder
EffectBuilder<REv>
api_version
ProtocolVersion
effect_builder
EffectBuilder<REv>
api_version
ProtocolVersion