Skip to main content

Crate nestrs

Crate nestrs 

Source

Re-exports§

pub use problem::ProblemDetails;

Modules§

core
prelude
problem
RFC 9457 Problem Details for HTTP APIs.
sse

Macros§

impl_routes
Registers HTTP routes for a #[controller] type. Each line: METHOD "path" with (RouteGuards...) => Handler,. Use with () when a route has no route-level guards. Route guards run inside (after) controller guards.
interceptor_layer
Axum middleware from an Interceptor type (uses I::default() per request).

Structs§

ApiVersioningPolicy
Policy for crate::NestApplication::enable_api_versioning.
AuthStrategyGuard
Runs AuthStrategy::validate for S: Default (JWT/API-key strategies you implement and mark Default when stateless).
AxumHttpEngine
Default engine: Axum Router.
BadGatewayException
BadRequestException
BearerToken
Requires a non-empty Authorization: Bearer … header and exposes the token (UTF-8).
CacheError
CacheModule
In-memory cache module (exporting CacheService).
CacheService
Cache service (in-memory by default; Redis available with feature cache-redis).
ClientIp
Extracts the best-effort client IP address for the current request.
ClientIpMissing
Returned when an IP address cannot be determined.
ConfigError
ConfigModule
Nest-like module for typed config providers.
ConflictException
CorsOptions
DiscoveryService
NestJS DiscoveryService analogue: introspect registered providers and compiled HTTP routes.
ExecutionContext
Cross-cutting context similar to NestJS ExecutionContext / ArgumentsHost for HTTP handlers (RPC/WS can set HostType when wired manually).
ExecutionContextMissing
Returned when HttpExecutionContext is used but the app did not enable crate::NestApplication::use_execution_context.
ForbiddenException
GatewayTimeoutException
GoneException
HttpException
HttpExecutionArguments
NestJS switchToHttp().getRequest()-style view without storing the full Axum request type.
HttpExecutionContext
Axum extractor for ExecutionContext (Nest-style ArgumentsHost snapshot).
I18n
I18nMissing
Returned when Locale / I18n extractors are used but crate::NestApplication::use_i18n was not enabled.
I18nModule
I18nOptions
I18nService
InternalServerErrorException
Locale
LoggingInterceptor
Logs method, path, status, and elapsed time at tracing debug level (target nestrs::interceptor).
MethodNotAllowedException
ModuleRef
NestJS ModuleRef analogue: typed access to the root ProviderRegistry after the application graph is built.
NestApiVersion
Resolved API version for the current request (e.g. "v1", "2").
NestApplication
NestFactory
NotAcceptableException
NotFoundException
NotImplementedException
OptionalBearerToken
Same as BearerToken but yields None when the header is missing or not a Bearer token.
ParseIntPipe
Parses a decimal string into i64 (e.g. after reading a path or query segment as String).
PayloadTooLargeException
PaymentRequiredException
RateLimitOptions
RawBody
Extracts the full request body as bytes (webhook-friendly raw body).
ReadinessContext
Holds indicators for NestApplication::enable_readiness_check; exposed so apps can reuse or test checks.
RequestContext
Snapshot of the inbound request for use inside handlers (clone is cheap: three small fields).
RequestContextMissing
Returned when RequestContext is used but crate::NestApplication::use_request_context was not enabled.
RequestScoped
Extracts an Arc<T> from the request-scoped DI cache.
RequestScopedMissing
Returned when request scope is not enabled on the app.
RequestTimeoutException
RequestTracingOptions
SecurityHeaders
ServiceUnavailableException
TestClient
TestRequest
TestingModule
TestingModuleBuilder
TooManyRequestsException
TracingConfig
Global tracing subscriber configuration (env filter + format).
UnauthorizedException
UnprocessableEntityException
UnsupportedMediaTypeException
ValidatedBody
ValidatedPath
Validates a path param-extracted DTO (NestJS ValidationPipe + @Param() analogue).
ValidatedQuery
Validates a query string-extracted DTO (NestJS ValidationPipe + @Query() analogue).
ValidationPipe
Validates a value using validator::Validate (NestJS ValidationPipe analogue).
XRoleMetadataGuard
Reads the caller role from the x-role header and checks it against #[roles("a,b")] metadata (same pattern as Nest metadata + guard).

Enums§

CacheOptions
HealthStatus
Result of a single HealthIndicator::check.
HostType
Active host kind (NestJS ArgumentsHost#getType).
PathNormalization
How NestApplication::use_path_normalization rewrites the request URI before routing.
TracingFormat
Log line format for TracingConfig / try_init_tracing.
VersioningType
Nest-style versioning modes beyond URI segments (see VersioningType).

Traits§

ExceptionFilter
Async hook invoked when a handler (or guard) produced an crate::HttpException response.
HealthIndicator
Pluggable readiness check (database ping, broker, external HTTP, etc.).
HttpServerEngine
Pluggable HTTP engine (NestJS “platform agnostic” idea). Only AxumHttpEngine is implemented today.
Interceptor
Around-advice: run logic before/after the inner pipeline by calling Next::run.
NestConfig
NestDto

Functions§

host_restriction_middleware
Rejects requests whose Host header does not match expected (port suffix ignored).
load_config
Load typed config from environment variables (optionally .env / .env.<env> in non-production), then run validator::Validate.
nestrs_default_not_found_handler
JSON 404 for unmatched routes; used when NestApplication::enable_default_fallback is set.
parse_authorization_bearer
Parses Authorization: Bearer <token> (case-insensitive scheme). Returns the token slice without allocating.
route_roles_csv
Comma-separated roles metadata for the current route (from MetadataRegistry), if any.
runtime_is_production
Returns true when the process environment indicates a production deployment.
strip_null_json_value
Recursively removes JSON null values from objects and arrays (shallow keys only at each level).
try_init_tracing
Installs the global tracing subscriber once (idempotent). Subsequent calls return the same result as the first.

Attribute Macros§

all
async_trait
controller
cron
delete
dto
event_pattern
event_routes
get
head
http_code
injectable
interval
message_pattern
micro_routes
module
on_event
openapi
options
patch
post
put
queue_processor
raw_body
redirect
response_header
roles
routes
schedule_routes
serialize
Wraps handler return values in axum::Json(...) (NestJS “return object => JSON” ergonomics).
set_metadata
sse
subscribe_message
use_filters
use_guards
use_interceptors
use_micro_guards
use_micro_interceptors
use_micro_pipes
use_pipes
use_ws_guards
use_ws_interceptors
use_ws_pipes
ver
version
ws_gateway
ws_routes

Derive Macros§

NestConfig
NestDto