open

Macro open 

Source
macro_rules! open {
    (async $open:expr, [$($arg:expr), +]) => { ... };
    ($open:expr, [$($arg:expr), +]) => { ... };
}
Expand description

A macro to create a MultiReaders instance by opening multiple values asynchronously or synchronously.

§Examples

// Using the macro with asynchronous opening
open!(async my_async_open, [val1, val2, val3]);
 
// Using the macro with synchronous opening
open!(my_open, [val1, val2, val3]);

§Parameters

  • async $open: The asynchronous open function (optional).
  • $open: The synchronous open function.
  • $arg: The arguments to be passed to the open function.

§Usage

  • When using the async $open form, each value will be awaited and then wrapped in the MultiReaders instance.
  • When using the form without async $open, the values will be opened synchronously and wrapped in the MultiReaders instance.