摘要:
环境 Time 2022-05-29 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考: https://github.com/tokio-rs/bytes https://zhuanlan.zhihu.com/p/109977513 目标 之前阅读的部分,都是关于静态的字节,后面开 阅读全文
posted @ 2022-08-30 08:20
jiangbo4444
阅读(81)
评论(0)
推荐(0)
摘要:
环境 Time 2022-05-28 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://github.com/tokio-rs/bytes 目标 实现 bytes.rs 中的一部分方法。 线程安全 实现了两个线程安全的标记接口。 unsafe impl Send fo 阅读全文
posted @ 2022-08-30 08:16
jiangbo4444
阅读(51)
评论(0)
推荐(0)
摘要:
环境 Time 2022-05-28 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://github.com/tokio-rs/bytes 目标 实现 bytes.rs 中的一部分方法。 split_off 在中间进行切割,分成两半。 pub fn split_off 阅读全文
posted @ 2022-08-30 08:14
jiangbo4444
阅读(54)
评论(0)
推荐(0)
摘要:
环境 Time 2022-05-28 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://github.com/tokio-rs/bytes 目标 实现 bytes.rs 中的一部分方法。 Deref 通过实现 Deref 来实现自动解引用,解引用成字节切片。 impl 阅读全文
posted @ 2022-08-30 08:12
jiangbo4444
阅读(64)
评论(0)
推荐(0)
摘要:
环境 Time 2022-05-28 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://github.com/tokio-rs/bytes 目标 实现 bytes.rs 中的一部分方法。 Drop 通过自定义的 Vtable 来实现 drop 方法。 impl Dro 阅读全文
posted @ 2022-08-30 08:11
jiangbo4444
阅读(74)
评论(0)
推荐(0)
摘要:
环境 Time 2022-05-28 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://github.com/tokio-rs/bytes 目标 了解从静态生命周期的字节中创建 bytes.rs,以及实现一部分方法。 from_static 根据一个静态生命周期的字节 阅读全文
posted @ 2022-08-30 08:07
jiangbo4444
阅读(66)
评论(0)
推荐(0)
摘要:
环境 Time 2022-05-27 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://github.com/tokio-rs/bytes 目标 了解 bytes.rs 中 Bytes 的结构定义。 lib.rs 首先将 bytes.rs 引入到 lib.rs 中,然 阅读全文
posted @ 2022-08-30 08:02
jiangbo4444
阅读(75)
评论(0)
推荐(0)