Skip to main content

Crate ferro_rs

Crate ferro_rs 

Source

Re-exports§

pub use api::api_key::generate_api_key;
pub use api::api_key::hash_api_key;
pub use api::api_key::verify_api_key_hash;
pub use api::api_key::ApiKeyInfo;
pub use api::api_key::ApiKeyMiddleware;
pub use api::api_key::ApiKeyProvider;
pub use api::api_key::GeneratedApiKey;
pub use api::openapi::build_openapi_spec;
pub use api::openapi::openapi_docs_response;
pub use api::openapi::openapi_json_response;
pub use api::openapi::OpenApiConfig;
pub use app::Application;
pub use auth::Auth;
pub use auth::AuthMiddleware;
pub use auth::AuthUser;
pub use auth::Authenticatable;
pub use auth::GuestMiddleware;
pub use auth::OptionalUser;
pub use auth::UserProvider;
pub use authorization::AuthResponse;
pub use authorization::Authorizable;
pub use authorization::AuthorizationError;
pub use authorization::Authorize;
pub use authorization::Gate;
pub use authorization::Policy;
pub use cache::Cache;
pub use cache::CacheConfig;
pub use cache::CacheStore;
pub use cache::InMemoryCache;
pub use cache::RedisCache;
pub use config::env;
pub use config::env;
pub use config::env_optional;
pub use config::env_required;
pub use config::AppConfig;
pub use config::Config;
pub use config::Environment;
pub use config::ServerConfig;
pub use container::App;
pub use container::Container;
pub use csrf::csrf_field;
pub use csrf::csrf_meta_tag;
pub use csrf::csrf_token;
pub use csrf::CsrfMiddleware;
pub use database::AutoRouteBinding;
pub use database::Database;
pub use database::DatabaseConfig;
pub use database::DatabaseType;
pub use database::DbConnection;
pub use database::Model;
pub use database::ModelMut;
pub use database::RouteBinding;
pub use database::DB;
pub use error::AppError;
pub use error::FrameworkError;
pub use error::HttpError;
pub use error::ValidationErrors;
pub use hashing::hash;
pub use hashing::needs_rehash;
pub use hashing::verify;
pub use hashing::DEFAULT_COST as HASH_DEFAULT_COST;
pub use http::bytes;
pub use http::json;
pub use http::text;
pub use http::Cookie;
pub use http::CookieOptions;
pub use http::FormRequest;
pub use http::FromParam;
pub use http::FromRequest;
pub use http::HttpResponse;
pub use http::InertiaRedirect;
pub use http::PaginationMeta;
pub use http::Redirect;
pub use http::Request;
pub use http::Resource;
pub use http::ResourceCollection;
pub use http::ResourceMap;
pub use http::Response;
pub use http::ResponseExt;
pub use http::SameSite;
pub use inertia::Inertia;
pub use inertia::SavedInertiaContext;
pub use lang::lang_choice;
pub use lang::lang_init;
pub use lang::locale;
pub use lang::set_locale;
pub use lang::t;
pub use lang::trans;
pub use lang::LangMiddleware;
pub use session::invalidate_all_for_user;
pub use session::session;
pub use session::session_mut;
pub use session::DatabaseSessionDriver;
pub use session::SessionConfig;
pub use session::SessionData;
pub use session::SessionMiddleware;
pub use session::SessionStore;
pub use inertia::InertiaContext;Deprecated
pub use metrics::get_metrics;
pub use metrics::MetricsSnapshot;
pub use metrics::RouteMetrics;
pub use metrics::RouteMetricsView;
pub use middleware::register_global_middleware;
pub use middleware::Limit;
pub use middleware::LimiterResponse;
pub use middleware::MetricsMiddleware;
pub use middleware::Middleware;
pub use middleware::MiddlewareFuture;
pub use middleware::MiddlewareRegistry;
pub use middleware::Next;
pub use middleware::RateLimiter;
pub use middleware::SecurityHeaders;
pub use middleware::Throttle;
pub use routing::get_registered_routes;
pub use routing::route;
pub use routing::validate_route_path;
pub use routing::FallbackDefBuilder;
pub use routing::GroupBuilder;
pub use routing::GroupDef;
pub use routing::GroupItem;
pub use routing::GroupRoute;
pub use routing::GroupRouter;
pub use routing::IntoGroupItem;
pub use routing::ResourceAction;
pub use routing::ResourceDef;
pub use routing::ResourceRoute;
pub use routing::RouteBuilder;
pub use routing::RouteDefBuilder;
pub use routing::RouteInfo;
pub use routing::Router;
pub use schedule::CronExpression;
pub use schedule::DayOfWeek;
pub use schedule::Schedule;
pub use schedule::Task;
pub use schedule::TaskBuilder;
pub use schedule::TaskEntry;
pub use schedule::TaskResult;
pub use seeder::DatabaseSeeder;
pub use seeder::Seeder;
pub use seeder::SeederRegistry;
pub use server::Server;
pub use broadcast::broadcasting_auth;
pub use validation::accepted;
pub use validation::alpha;
pub use validation::alpha_dash;
pub use validation::alpha_num;
pub use validation::array;
pub use validation::between;
pub use validation::boolean;
pub use validation::confirmed;
pub use validation::date;
pub use validation::different;
pub use validation::email;
pub use validation::in_array;
pub use validation::integer;
pub use validation::max;
pub use validation::min;
pub use validation::not_in;
pub use validation::nullable;
pub use validation::numeric;
pub use validation::regex;
pub use validation::register_validation_translator;
pub use validation::required;
pub use validation::required_if;
pub use validation::same;
pub use validation::string;
pub use validation::url;
pub use validation::validate;
pub use validation::Rule;
pub use validation::TranslatorFn;
pub use validation::Validatable;
pub use validation::ValidationError;
pub use validation::Validator;
pub use testing::Factory;
pub use testing::FactoryBuilder;
pub use testing::Fake;
pub use testing::Sequence;
pub use testing::TestClient;
pub use testing::TestContainer;
pub use testing::TestContainerGuard;
pub use testing::TestDatabase;
pub use testing::TestRequestBuilder;
pub use testing::TestResponse;
pub use utoipa;
pub use utoipa_redoc;
pub use serde;
pub use validator;

Modules§

api
app
Application builder for Ferro framework
auth
Authentication module for Ferro framework
authorization
Authorization system for Ferro framework.
broadcast
Broadcasting integration for channel authorization.
cache
Cache module for Ferro framework
config
Configuration module for Ferro framework
container
Application Container for Dependency Injection
csrf
CSRF protection for Ferro framework
database
Database module for Ferro framework
debug
Debug introspection endpoints for development
error
Framework-wide error types
hashing
Password hashing for Ferro framework
http
inertia
Inertia.js integration for Ferro framework.
lang
Per-request locale context for Ferro framework.
metrics
Request metrics collection for performance monitoring
middleware
Middleware system for Ferro framework
routing
schedule
Task Scheduler module for Ferro framework
seeder
Database seeding for Ferro framework
server
session
Session management for Ferro framework
testing
Testing utilities for Ferro framework
validation
Request validation for Ferro framework.

Macros§

bind
Bind a trait to a singleton implementation (auto-wraps in Arc)
bind_factory
Bind a trait to a factory (auto-wraps in Arc, new instance each resolution)
can
Macro for creating authorization middleware.
define_scopes
Macro to define scopes for an entity
delete
Create a DELETE route definition with compile-time path validation
describe
Group related tests with a descriptive name
expect
Create an expectation for fluent assertions
factory
Register a factory (concrete type, new instance each resolution)
fallback
Create a fallback route definition
get
Create a GET route definition with compile-time path validation
global_middleware
Register global middleware that runs on every request
group
Define a route group with a shared prefix
impl_batch_load
Macro to implement BatchLoad for an entity with a primary key
impl_batch_load_many
Macro to implement BatchLoadMany for has_many relationships
inertia_response
Create an Inertia response with compile-time component validation
json_response
patch
Create a PATCH route definition with compile-time path validation
post
Create a POST route definition with compile-time path validation
put
Create a PUT route definition with compile-time path validation
redirect
Create a redirect to a path or named route
resource
Define RESTful resource routes with convention-over-configuration
route_binding
Convenience macro to implement RouteBinding for a SeaORM model
routes
Define routes with a clean, Laravel-like syntax
rules
Macro for creating a vector of boxed validation rules.
schedule_task
Macro for creating closure-based tasks more ergonomically
singleton
Register a singleton instance (concrete type)
test
Define an individual test case with a descriptive name
test_database
Create a test database with default migrator
text_response
txn
Macro for cleaner transaction syntax

Structs§

AuthData
Authorization data for private/presence channels.
Broadcast
A fluent builder for broadcasting messages.
BroadcastBuilder
Builder for constructing a broadcast message.
BroadcastClient
A connected client.
BroadcastConfig
Configuration for the broadcaster.
BroadcastMessage
A message that can be broadcast to channels.
Broadcaster
The broadcaster manages channels and client connections.
ChannelInfo
Information about a channel.
ChannelResult
Result of sending a notification through a channel.
DatabaseMessage
A database message for in-app notifications.
Disk
A handle to a specific disk.
DiskConfig
Storage disk configuration.
EventDispatcher
Global event dispatcher.
FileMetadata
File metadata.
InertiaConfig
Configuration for Inertia.js responses.
InertiaResponse
Internal response builder.
InertiaShared
Shared props that are merged into every Inertia response.
JobPayload
Serialized job payload stored in the queue.
LangConfig
Type-safe localization configuration.
LangConfigBuilder
Builder for LangConfig.
LocalDriver
Local filesystem storage driver.
MailConfig
Mail configuration supporting multiple drivers.
MailMessage
A mail message for email notifications.
NotificationConfig
Configuration for the notification dispatcher.
NotificationDispatcher
The notification dispatcher.
PendingDispatch
A pending job dispatch.
PresenceMember
A member in a presence channel.
PutOptions
Options for storing files.
Queue
Queue facade for static access.
QueueConfig
Queue system configuration.
QueueConnection
A connection to the queue backend.
ResendConfig
Resend-specific configuration.
SlackAttachment
A Slack message attachment.
SlackField
A field within a Slack attachment.
SlackMessage
A Slack message for webhook notifications.
SmtpConfig
SMTP-specific configuration.
Storage
Storage facade for file operations.
StorageMemoryDriver
In-memory storage driver.
StoredNotification
A notification stored in the database.
TaggableCache
Main cache facade.
TaggableCacheConfig
Cache store configuration.
TaggableCacheMemoryStore
In-memory cache store.
TaggedCache
A cache instance with tags for grouped operations.
Translator
Core translation engine.
Worker
Queue worker that processes jobs.
WorkerConfig
Worker configuration.

Enums§

BroadcastError
Errors that can occur during broadcasting.
ChannelType
Channel type based on prefix.
ClientMessage
A client-to-server message.
DiskDriver
Available disk drivers.
EventError
Errors that can occur in the event system.
LangError
Errors that can occur during translation loading and lookup.
MailDriver
Mail transport driver.
NotificationChannel
Available notification channels.
NotificationError
Errors that can occur during notification dispatch.
QueueError
Errors that can occur in the queue system.
ServerMessage
A server-to-client message.
StorageError
Storage error types.
TaggableCacheError
Cache error types.
Visibility
Visibility of stored files.

Traits§

ActiveModelTrait
A Trait for ActiveModel to perform Create, Update or Delete operation. The type must also implement the EntityTrait. See module level docs crate::entity for a full example
ChannelAuthorizer
Trait for authorizing channel access.
ColumnTrait
API for working with a Column. Mostly a wrapper of the identically named methods in sea_query::Expr
DatabaseNotificationStore
Extension trait for database notification storage.
EntityTrait
An abstract base class for defining Entities.
Event
Marker trait for events that can be dispatched.
IntoActiveModel
A Trait for any type that can be converted into an ActiveModel
Job
A job that can be executed by a queue worker.
Listener
A listener that handles events of type E.
ModelTrait
The interface for Model, implemented by data structs
Notifiable
Trait for entities that can receive notifications.
Notification
A notification that can be sent through multiple channels.
PaginatorTrait
A Trait for any type that can paginate results
QueryFilter
Perform a FILTER opertation on a statement
QueryOrder
Performs ORDER BY operations
QuerySelect
Abstract API for performing queries
Queueable
Trait for types that can be dispatched to a queue.
ShouldQueue
Marker trait for listeners that should be queued for background processing.
StorageDriver
Storage driver trait.
TaggableCacheStore
Cache store trait.
Validate
This is the original trait that was implemented by deriving Validate. It will still be implemented for struct validations that don’t take custom arguments. The call is being forwarded to the ValidateArgs<'v_a> trait.

Functions§

dispatch_event
Dispatch an event using the global dispatcher.
dispatch_later
Dispatch a job with a delay.
dispatch_sync
Dispatch an event synchronously (fire and forget).
dispatch_to
Dispatch a job to a specific queue.
queue_dispatch
Dispatch a job using the global queue.

Attribute Macros§

async_trait
domain_error
Define a domain error with automatic HTTP response conversion
ferro_test
Attribute macro for database-enabled tests
handler
Attribute macro for controller handler methods
injectable
Attribute macro to auto-register a concrete type as a singleton
request
Attribute macro for clean request data definition
service
Mark a trait as a service for the App container

Derive Macros§

ApiResource
Derive macro for generating Resource trait implementation from struct annotations
FerroModel
Derive macro for reducing SeaORM model boilerplate
FormRequestDerive
Derive macro for FormRequest trait
InertiaProps
Derive macro for generating Serialize implementation for Inertia props
Validate
ValidateRules
Derive macro for declarative struct validation using Ferro’s rules