随笔分类 -  Bytes

摘要:环境 Time 2022-05-29 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://docs.rs/bytes/latest/bytes/trait.BufMut.html 目标 使用 BufMut 的方法。 remaining_mut fn main() { l 阅读全文
posted @ 2022-09-30 20:26 jiangbo4444 阅读(142) 评论(0) 推荐(0) 编辑
摘要:环境 Time 2022-05-29 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://docs.rs/bytes/latest/bytes/struct.BytesMut.html 目标 使用 BytesMut 的方法。 with_capacity fn main( 阅读全文
posted @ 2022-09-30 20:25 jiangbo4444 阅读(462) 评论(0) 推荐(0) 编辑
摘要:环境 Time 2022-05-29 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://docs.rs/bytes/latest/bytes/trait.Buf.html 目标 Bytes 实现了 Buf,使用一下其中的方法。 remaining fn main() 阅读全文
posted @ 2022-09-30 20:23 jiangbo4444 阅读(38) 评论(0) 推荐(0) 编辑
摘要:环境 Time 2022-05-29 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://docs.rs/bytes/latest/bytes/struct.Bytes.html 目标 Bytes 的源码基本上看完了,简单使用一下其中的方法。 new fn main() 阅读全文
posted @ 2022-09-30 20:21 jiangbo4444 阅读(43) 评论(0) 推荐(0) 编辑
摘要:环境 Time 2022-05-29 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://github.com/tokio-rs/bytes 目标 Buf 是一个 trait,里面有几个方法需要实现,Bytes 实现了 Buf。 remaining fn remaini 阅读全文
posted @ 2022-09-30 20:20 jiangbo4444 阅读(40) 评论(0) 推荐(0) 编辑
摘要:环境 Time 2022-05-29 Rust 1.61.0 Bytes 1.1.0 前言 说明 参考:https://github.com/tokio-rs/bytes 目标 Bytes 实现迭代器。 IntoIter #[derive(Debug)] pub struct IntoIter<T> 阅读全文
posted @ 2022-09-30 20:17 jiangbo4444 阅读(34) 评论(0) 推荐(0) 编辑
摘要:环境 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-31 23:37 jiangbo4444 阅读(64) 评论(0) 推荐(0) 编辑
摘要:环境 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:22 jiangbo4444 阅读(74) 评论(0) 推荐(0) 编辑
摘要:环境 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 阅读(67) 评论(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 阅读(42) 评论(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 阅读(45) 评论(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 阅读(49) 评论(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 阅读(64) 评论(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 阅读(54) 评论(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 阅读(56) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示