FunctionalRust icon indicating copy to clipboard operation
FunctionalRust copied to clipboard

FunctionalRust

My image My image

Author Pablo Picouto Garcia

Is this repo useful? Please ⭑Star this repository and share the love.

Examples of functional programing in Rust

Features

  • Functions

  • Type Classes

  • Effect system

  • Extension method

  • Memory management

  • Collection

  • async-await

  • channels

  • promise

  • pattern matching

  • smart pointer

  • NewTypes

  • Do notation

  • Union type

  • Lens

  • Dependency injection

Monads

Implementation of some of the most famous Monads you can find in Haskel or Scala

  • Monad
  • Try Monad
  • Either Monad

Rust_IO

Macro implementation for [rust_io] defining several operators to be used emulating Haskel [do notation]

  • RustIO

Crates dependency

RxRust

My image

A Rust implementation of Reactive Extensions

  • features

Tokio

Features

  • select

Hyper

Fast and safe HTTP for the Rust language.

  • Client/Server

Tonic

A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility.

  • Protobuf
  • Client
  • Server

Actix

My image

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

  • Server
  • Web-Server

Kafka

My image

Code example of Kafka consumer/producer and benchmark result producing/consuming 1000 records with 100kb size.

  • Consumer
  • Producer

Red Panda

My image

Code example of Red Panda consumer/producer and benchmark result producing/consuming 1000 records with 100kb size.

  • Consumer
  • Producer

Dynamic loading

Dynamic loading, also known as dynamic linking or runtime linking, is a technique that allows programs to load and use external code (such as libraries) at runtime, instead of statically linking them at compile time

  • Contract
  • Plugin
  • Program

Patterns

My image

Creational

  • Singleton
  • Builder
  • Factory

Structural

  • Composite
  • Decorator
  • Facade

Behavioral

  • Chain of responsibility
  • Memento
  • Strategy

Architecture

  • Circuit breaker

Performance

Goose

Goose is a Rust load testing tool inspired by Locust.

  • Simulation
  • Mock server

Benchmark

 === PER REQUEST METRICS ===
 ------------------------------------------------------------------------------
 Name                     |        # reqs |        # fails |    req/s |  fail/s
 ------------------------------------------------------------------------------
 GET /hello               |       435,482 |         0 (0%) |     3629 |    0.00
 ------------------------------------------------------------------------------
 Name                     |    Avg (ms) |        Min |         Max |     Median
 ------------------------------------------------------------------------------
 GET /hello               |        3.90 |          1 |         103 |          4
 ------------------------------------------------------------------------------
 Slowest page load within specified percentile of requests (in ms):
 ------------------------------------------------------------------------------
 Name                     |    50% |    75% |    98% |    99% |  99.9% | 99.99%
 ------------------------------------------------------------------------------
 GET /hello               |      4 |      5 |      8 |     10 |     16 |     23
 ------------------------------------------------------------------------------
 Name                     |                                        Status codes 
 ------------------------------------------------------------------------------
 GET /hello               |                                       435,482 [200]
 -------------------------+----------------------------------------------------
 Aggregated               |                                       435,482 [200] 

 === OVERVIEW ===
 ------------------------------------------------------------------------------

Games

My image

  • Dragon Ball Z

  • Monkey Island

  • Golden Axe

  • Street Fighter 2

  • Street of Rage