sink 0.1.0

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.
Documentation
  • Coverage
  • 50%
    8 out of 16 items documented0 out of 7 items with examples
  • Size
  • Source code size: 14.62 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.23 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • PerryBirch

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