Coder Social home page Coder Social logo

darrenbaldwin07 / actix-web-lab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robjtede/actix-web-lab

0.0 0.0 0.0 554 KB

Experimental extractors, middleware, and other extras for possible inclusion in Actix Web.

License: Apache License 2.0

Shell 0.32% Rust 99.15% HTML 0.52%

actix-web-lab's Introduction

actix-web-lab

Experimental extractors, middleware, and other extras for possible inclusion in Actix Web.

crates.io Documentation MIT or Apache 2.0 licensed
dependency status Download CircleCI

Features

Feature Voting โ†’

Responders

  • Csv: efficient CSV streaming (docs)
  • NdJson: efficient NDJSON streaming (docs)
  • DisplayStream: efficient line-by-line Display streaming (docs)
  • Html: basic string wrapper that responds with HTML Content-Type (docs)
  • Cbor: basic CBOR format wrapper with appropriate Content-Type (docs)
  • MessagePack: basic MessagePack format wrapper with appropriate Content-Type (docs)
  • Sse: semantic server-sent events (SSE) responder with a channel-like interface (docs)

Middleware

  • from_fn: use an async function as a middleware (docs)
  • map_response: use an async function to modify the response (docs)
  • map_response_body: use an async function to modify the response body (docs)
  • RedirectHttps: middleware to redirect traffic to HTTPS if connection is insecure with optional HSTS (docs)
  • redirect_to_www: function middleware to redirect traffic to www. if not already there (docs)
  • ErrorHandlers: alternative error handler middleware with simpler interface (docs)
  • NormalizePath: alternative path normalizing middleware with redirect option (docs)
  • CatchPanic: catch panics in wrapped handlers and middleware, returning empty 500 responses (docs)
  • PanicReporter: catch panics in wrapped handlers and middleware, returning empty 500 responses (docs)
  • LoadShed: sheds load when the inner service isn't ready (docs)

Extractors

  • LazyData: app data/state initialized on first use (docs)
  • SwapData: app data/state that can be replaced at runtime (alternative to Data<RwLock<T>>) (docs)
  • LocalData: app data/state that uses an Rc internally, avoiding atomic overhead (alternative to Data<RwLock<T>>) (docs)
  • Json: simplified JSON extractor with const-generic payload limits (docs)
  • Path: simplified path parameter extractor that supports destructuring (docs)
  • Query: simplified query-string extractor that can also collect multi-value items (docs)
  • RequestSignature: wraps an extractor and calculates a request signature alongside (docs)
  • BodyLimit: wraps a body extractor and prevents DoS attacks by limiting payload size (docs)
  • Bytes: simplified Bytes extractor with const-generic limits (docs)
  • UrlEncodedForm: URL-encoded form extractor with const-generic payload size limit (docs)
  • Host: Host information taken from either URL or Host header (docs)

Macros

  • FromRequest: Derive macro to implement FromRequest on an aggregate struct of other extractors (docs)

Headers

  • StrictTransportSecurity: Strict-Transport-Security (HSTS) configuration (docs)
  • CacheControl: Cache-Control typed header with support for modern directives (docs)
  • ContentLength: Content-Length typed header (docs)
  • Forwarded: Proxy and original client info (docs)

Body Types

  • channel: a simple channel-like body type with a sender side that can be used from another thread (docs)
  • writer: a simple AsyncWrite body type (docs)

Services

  • Redirect: (graduated ๐ŸŽ‰) simple redirects (docs)
  • spa: Easy Single-page Application (SPA) service (docs)

Route Guards

  • Acceptable: (graduated ๐ŸŽ‰) verifies that an Accept header is present and it contains a compatible MIME type (docs)

Test Utilities

  • test_request: construct TestRequest using an HTTP-like DSL (docs)
  • assert_response_matches: quickly write tests that check various parts of a ServiceResponse (docs)

Other Utilities

  • fork_request_payload: effectively clone a request payload (docs)

Things To Know About This Crate

  • It will never reach v1.0.
  • Minimum Supported Rust Version (MSRV) is latest stable at the time of each release.
  • Breaking changes will likely happen on most 0.x version bumps.
  • Documentation might be limited for some items.
  • Items that graduate to Actix Web crate will be marked deprecated here for a reasonable amount of time so you can migrate.
  • Migrating will often be as easy as dropping the _lab suffix from imports.

actix-web-lab's People

Contributors

aliemjay avatar andreiormanji avatar robjtede avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.