Skip to main content

Crate rustf

Crate rustf 

Source
Expand description

RustF - A simple MVC web framework inspired by Total.js

RustF provides a convention-based MVC framework for Rust with:

  • Total.js-style controller routing
  • Simple template engine
  • Session and flash message support
  • Model loading system

Re-exports§

pub use app::RustF;
pub use config::AppConfig;
pub use context::Context;
pub use error::Error;
pub use error::Result;
pub use http::FileCollection;
pub use http::FormData;
pub use http::FormValue;
pub use http::Request;
pub use http::Response;
pub use http::RunningServer;
pub use http::ServerHandle;
pub use http::UploadedFile;
pub use middleware::InboundAction;
pub use middleware::InboundMiddleware;
pub use middleware::MiddlewareResult;
pub use middleware::OutboundMiddleware;
pub use routing::BeforeAction;
pub use routing::BeforeFn;
pub use routing::Route;
pub use routing::RouteHandler;
pub use websocket::ClientId;
pub use websocket::CloseCode;
pub use websocket::Message;
pub use websocket::SocketClient;
pub use websocket::SocketRoom;
pub use websocket::WebSocket;
pub use websocket::WebSocketReceiver;
pub use websocket::WebSocketSender;
pub use websocket::SOCKET;
pub use configuration::CONF;
pub use configuration::DEBUG;
pub use db::DB;
pub use events::builtin;
pub use events::EventContext;
pub use events::EventEmitter;
pub use pool::global_request_pool;
pub use pool::PooledRequest;
pub use pool::RequestPool;
pub use repository::APP;
pub use repository::MAIN;
pub use security::CsrfConfig;
pub use security::CsrfMiddleware;
pub use security::HtmlEscaper;
pub use security::InputValidator;
pub use security::PathValidator;
pub use security::SecurityConfig;
pub use session::factory::SessionStorageFactory;
pub use session::redis::RedisSessionStorage;
pub use session::Session;
pub use session::SessionData;
pub use session::SessionStorage;
pub use session::SessionStore;
pub use session::StorageStats;
pub use shared::SharedModule;
pub use shared::SharedModuleType;
pub use shared::SharedRegistry;
pub use shared::MODULE;
pub use utils::Utils;
pub use utils::U;
pub use db::database_status;
pub use migrations::Migration;
pub use migrations::MigrationDirection;
pub use migrations::MigrationManager;
pub use workers::WorkerContext;
pub use workers::WorkerManager;
pub use workers::WORKER;
pub use views::VIEW;
pub use views::embed_provider::get_assets_provider;
pub use views::embed_provider::get_views_provider;
pub use views::embed_provider::register_assets_provider;
pub use views::embed_provider::register_views_provider;
pub use views::embed_provider::EmbeddedFileProvider;
pub use rust_embed;

Modules§

app
auto
cache
cli
Command-line interface support for RustF applications
config
configuration
Global configuration access for RustF framework
context
database
Multi-database support module for RustF
db
Global database access for RustF framework
definitions
RustF Definitions System - Simplified
error
events
Event Emitter System for RustF
forms
Form generation and validation utilities
http
middleware
RustF Middleware System
migrations
Database migration system for RustF framework
models
pool
Object pooling system for Request structures
prelude
Prelude module for common imports
repository
Global repository access for RustF framework
routing
security
Security utilities and protection mechanisms for RustF framework
session
shared
Shared code module system for RustF
utils
Global utilities module for RustF framework
views
websocket
WebSocket support.
workers
Worker System for RustF

Macros§

MODEL
auto_controllers
Auto-discover and include all controllers from src/controllers/*.rs
auto_definitions
Auto-discover and include all definitions from src/definitions/*.rs
auto_events
Auto-discover and include all event handlers from src/events/*.rs
auto_middleware
Auto-discover and include all middleware from src/middleware/*.rs
auto_models
Auto-discover and include all models from src/models/*.rs
auto_modules
Auto-discover and include all modules from src/modules/*.rs
auto_workers
Auto-discover and include all workers from src/workers/*.rs
context
Macro for easy error context chaining
error_with_context
Macro for creating errors with context
handler
Helper function for creating async event handlers
impl_shared_helper
Convenience macro for implementing SharedModule trait for helper structs
impl_shared_service
Convenience macro for implementing SharedModule trait for service structs
impl_shared_util
Convenience macro for implementing SharedModule trait for utility structs
json
Construct a serde_json::Value from a JSON literal.
routes

Enums§

Value
Represents any valid JSON value.

Traits§

Deserialize
A data structure that can be deserialized from any data format supported by Serde.
Model
Serialize
A data structure that can be serialized into any data format supported by Serde.

Attribute Macros§

auto_discover
Auto-discover and generate module declarations for the entire application

Derive Macros§

Deserialize
Derive macro available if serde is built with features = ["derive"].
Serialize
Derive macro available if serde is built with features = ["derive"].