zyn.RouteDefault#
/// A CSRF mode, layout, hook, guard, or rate limit applied to routes.
pub const RouteDefault = union(enum) {
pub const Csrf = enum {
protected,
exempt,
};
csrf_mode: Csrf,
layout_name: []const u8,
hook_callback: RouteHook,
guard_callback: RouteGuard,
rate_limit_config: RateLimit.Config,
/// Sets Fetch Metadata CSRF handling for a route scope.
pub fn csrf(mode: Csrf) RouteDefault;
/// Adds a view layout to a route scope.
pub fn layout(template_name: []const u8) RouteDefault;
/// Adds a wrapping hook to a route scope.
pub fn hook(callback: RouteHook) RouteDefault;
/// Adds a guard to a route scope.
pub fn guard(callback: RouteGuard) RouteDefault;
/// Adds a request allowance to this route scope.
pub fn rate_limit(comptime config: RateLimit.Config) RouteDefault;
};