1 unstable release

0.1.0 Jul 26, 2021

#65 in #blocking

MIT/Apache

26KB
535 lines

breadx-blocking

Provides something similar to blocking::Unblock, but for breadx displays.

License

MIT/Apache2 License


lib.rs:

This crate provides the BlockingDisplay and BlockingDisplayImmut objects, which allow the user to convert a breadx::Display into a breadx::AsyncDisplay.

Occasionally, you have an object that implements breadx::Display that you need to implement breadx::AsyncDisplay. Although the *Display objects in breadx can be easily changed to implement breadx::AsyncDisplay by changing the Connection to an AsyncConnection, Display implementations outside of breadx may not share this guarantee.

BlockingDisplay<T> implements AsyncDisplay when T implements Display. BlockingDisplayImmut<T> implements AsyncDisplay and &AsyncDisplay when T implements &Display.

This is implemented on the blocking thread-pool when the tokio feature is not enabled, and is implemented via spawn_blocking when it is.

Dependencies

~9–20MB
~296K SLoC