scope-functions 1.1.0

This crate provides Kotlin-inspired scope functions for use in almost any situation.
Documentation
  • Coverage
  • 88.24%
    15 out of 17 items documented0 out of 6 items with examples
  • Size
  • Source code size: 13.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 492.24 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • AnastasiyaSoyka/scope-functions
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • apsoyka

scope-functions is a Rust crate that provides several Kotlin-inspired scope functions for use in almost any situation.

Introduction

A scope function is a function whose sole purpose is to execute a block of code within the context of an object. Such functions accept a higher-order function, or closure, as their sole argument, and allow the programmer to perform operations on that object within a separate scope.

For example, a scope function may be used to perform an extra operation on an object before assigning it to a variable. This crate provides three types of scope functions: apply, run, and with.

Function Selection

Function Return Value
run Closure Result
with Closure Result
apply Context Object