13namespace mcp::server {
Abstract policy hook for request rate limiting.
Definition rate_limit.hpp:40
virtual core::Result< RateLimitDecision > check(const RateLimitRequest &request)=0
Check whether a request should be admitted.
Shared result and error primitives used by the public cxxmcp SDK.
tl::expected< T, Error > Result
Alias for the SDK result type.
Definition result.hpp:64
Outcome returned by a RateLimiter.
Definition rate_limit.hpp:27
bool allowed
True when the request may proceed.
Definition rate_limit.hpp:29
std::chrono::milliseconds retry_after
Suggested retry delay for rejected requests; zero means unspecified.
Definition rate_limit.hpp:31
Transport-neutral request facts used for rate limit decisions.
Definition rate_limit.hpp:16
std::size_t request_bytes
Approximate serialized request size in bytes, when available.
Definition rate_limit.hpp:23
std::string subject
Subject being limited, typically an authenticated principal or remote address.
Definition rate_limit.hpp:19
std::string method
MCP method name associated with the request.
Definition rate_limit.hpp:21