sink

Crates.iosink
lib.rssink
version0.1.0
sourcesrc
created_at2018-07-20 23:26:42.202365
updated_at2018-07-20 23:26:42.202365
descriptionThis crate aims to provide an abstraction for a thing which can be sent values and, immediately, return a Result indicating success / failure of receipt. As a base primitive this should enable a message oriented variant of the inbound params to the familiar imperitive Result 'and_then' composition pattern.
homepage
repositoryhttps://github.com/omnivers3/sink
max_upload_size
id75291
size14,997
Perry Birch (PerryBirch)

documentation

README

omnivers3/sink

This crate aims to provide an abstraction for a thing which can be sent values and, immediately, return a Result indicating success / failure of receipt.

As a base primitive this should enable a message oriented variant of the inbound params to the familiar imperitive Result 'and_then' composition pattern.

Background

A primary goal of the interface for ISink is to hide the implementation details of any sink.

Some decisions were made in order to facilitate that:

  • Send takes Sink reference

We don't want to consume the sink so that it can be reused to send many times.

We also don't want to require the sender maintain a mutable reference to the sink.

  • Delegated Mutation

StatefulSink requires that the creator manages mutation by taking ownership of the state type in it's struct.

This means that mutation and thread-safety level concerns are pushed out to the implementors.

  • Send takes ownership of the sent value

Similar to Delegated Mutation, this forces the sender to be responsible for sharing, thread-safety, etc.

This also means that downstream recipients are explicitly decoupled from the originating source.

Some Helpful References

Implementing Function Composition

Railway Oriented Programming

CI/CD

Building a Rust Project on CircleCI

To Get RustFmt Options:

rustup run nightly -- rustfmt --help
Commit count: 47

cargo fmt