Crates.io | sink |
lib.rs | sink |
version | 0.1.0 |
source | src |
created_at | 2018-07-20 23:26:42.202365 |
updated_at | 2018-07-20 23:26:42.202365 |
description | 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. |
homepage | |
repository | https://github.com/omnivers3/sink |
max_upload_size | |
id | 75291 |
size | 14,997 |
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.
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:
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.
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.
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.
Implementing Function Composition
Building a Rust Project on CircleCI
To Get RustFmt Options:
rustup run nightly -- rustfmt --help