poee 0.1.0

Functions for efficient development
Documentation
  • Coverage
  • 60%
    3 out of 5 items documented3 out of 3 items with examples
  • Size
  • Source code size: 15.22 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.75 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 34s Average build duration of successful builds.
  • all releases: 34s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • zinso

Macros for efficient development

Crates.io Rust license

Examples

Spawns a new asynchronous task, returning a JoinHandle for it.

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    poee::spawn(||{
        std::fs::write("demo0", "rust").unwrap();
    });
    fn demo(){
        std::fs::write("demo1", "rust").unwrap();
    }
    poee::spawn(demo);

    Ok(())
 }

Runs the provided closure on a thread where blocking is acceptable.

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
   poee::spawn_blocking(||{
       std::fs::write("demo0", "rust").unwrap();
   });
   fn demo(){
       std::fs::write("demo1", "rust").unwrap();
   }
   poee::spawn_blocking(demo);

   Ok(())
}    

executed on the async code in sync

fn main(){
   async fn demo(){
       println!("demo");
   }
   poee::sync_fn(demo());
}