这个库是 Asynchronix 的一个分支,它持续努力地构建用于系统仿真的高性能异步计算框架。
这是一个简洁的异步通道,以快速著称,但也不会在正确性和质量方面取巧。它的性能主要来自于对 MPSC 用例的关注和一些精心的优化,包括:
示例:
use tachyonix;
use futures_executor::{block_on, ThreadPool};
let pool = ThreadPool::new().unwrap();
let (mut s, mut r) = tachyonix::channel(3);
block_on( async move {
pool.spawn_ok( async move {
assert_eq!(s.send("Hello").await, Ok(()));
});
assert_eq!(r.recv().await, Ok("Hello"));
});
GitHub:https://github.com/asynchronics/tachyonix
使用指南:
USAGE:
rsre FILE/DIRECTORY NEW_FULL_NAME
OPTIONS:
-h, --help Print help information
-V, --version Print version information
示例:
# with mv
mv ../../foo/bar/bat/foo.txt ../../foo/bar/bat/bar.txt
# with rsre
rsre ../../foo/bar/bat/foo.txt bar.txt
GitHub:https://github.com/TheAwiteb/rsre
有许多我们不希望发生的错误,但即便错了我们也不希望 panic
,当然我们也不想花太多时间处理意外错误。这就是本项目的用途,你可以保留意外错误,直到以后再担心它们。
示例:
use exun::*;
fn foo(num: &str) -> Result<i32, RawUnexpected> {
// 使用 `unexpect` 表示我们预计不会发生这个错误
let num = num.parse::<i32>().unexpect()?;
Ok(num)
}
use std::error::Error;
use std::fmt::{self, Display};
use exun::*;
#[derive(Debug)]
struct NoNumberError;
impl Display for NoNumberError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "no number provided")
}
}
impl Error for NoNumberError {}
fn foo(num: Option<&str>) -> Result<i32, Expect<NoNumberError>> {
let num = num.ok_or(NoNumberError)?; // 预计这可能会返回一个错误
let num = num.parse::<i32>().unexpect()?; // 但我们认为这个数字是可以解析的
Ok(num)
}
use std::error::Error;
use std::fmt::{self, Display};
use std::num::ParseIntError;
use exun::*;
#[derive(Debug)]
struct NoNumberError;
impl Display for NoNumberError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "no number provided")
}
}
impl Error for NoNumberError {}
fn foo(num: Option<&str>) -> Result<i32, Exun<&str, ParseIntError>> {
// 预计可能不会得到一个数字,所以这样处理
let num = match num {
Some(num) => num,
None => return Err(Expected("no number provided")),
};
// 但是,我们希望这个数字是可以解析的
match num.parse() {
Ok(int) => Ok(int),
Err(e) => Err(Unexpected(e))
}
}
GitHub:https://github.com/botahamec/exun
使用 Rust 和 Bevy 制作的开源横向展开的太空射击游戏。
Demo:https://larsdu.github.io/StarRust/
GitHub:https://github.com/LarsDu/StarRust
COSMIC Text 提供了高级文本变形、布局和渲染。这些都被包含在一个简单抽象中。
GitHub:https://github.com/pop-os/cosmic-text
From 日报小组 长琴
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有