capric 最近的时间轴更新
capric

capric

V2EX 第 228267 号会员,加入于 2017-04-29 07:50:15 +08:00
capric 最近回复了
23 天前
回复了 HkMuxxx 创建的主题 iPhone iPhone 镜像耗电吗?
不是 DLNA ,AirPlay 镜像是屏幕声音录制,编码,加密,传输,显示端接收、解密,解码渲染,加密和编码有硬件加速,具体耗电量还得结合码率、画质看
楼上用的哪里的国补啊,我看北京的用不了啊
65 天前
回复了 bli22ard 创建的主题 Rust rust TcpStream 为什么设计读写一体
@bli22ard 实现在这里,就是很简单的 Arc 和 clone
```rust
/// Owned read half of a [`TcpStream`], created by [`into_split`].
///
/// Reading from an `OwnedReadHalf` is usually done using the convenience methods found
/// on the [`AsyncReadExt`] trait.
///
/// [`TcpStream`]: TcpStream
/// [`into_split`]: TcpStream::into_split()
/// [`AsyncReadExt`]: trait@crate::io::AsyncReadExt
#[derive(Debug)]
pub struct OwnedReadHalf {
inner: Arc<TcpStream>,
}

/// Owned write half of a [`TcpStream`], created by [`into_split`].
///
/// Note that in the [`AsyncWrite`] implementation of this type, [`poll_shutdown`] will
/// shut down the TCP stream in the write direction. Dropping the write half
/// will also shut down the write half of the TCP stream.
///
/// Writing to an `OwnedWriteHalf` is usually done using the convenience methods found
/// on the [`AsyncWriteExt`] trait.
///
/// [`TcpStream`]: TcpStream
/// [`into_split`]: TcpStream::into_split()
/// [`AsyncWrite`]: trait@crate::io::AsyncWrite
/// [`poll_shutdown`]: fn@crate::io::AsyncWrite::poll_shutdown
/// [`AsyncWriteExt`]: trait@crate::io::AsyncWriteExt
#[derive(Debug)]
pub struct OwnedWriteHalf {
inner: Arc<TcpStream>,
shutdown_on_drop: bool,
}

pub(crate) fn split_owned(stream: TcpStream) -> (OwnedReadHalf, OwnedWriteHalf) {
let arc = Arc::new(stream);
let read = OwnedReadHalf {
inner: Arc::clone(&arc),
};
let write = OwnedWriteHalf {
inner: arc,
shutdown_on_drop: true,
};
(read, write)
}
```
66 天前
回复了 bli22ard 创建的主题 Rust rust TcpStream 为什么设计读写一体
98 天前
回复了 7911364440 创建的主题 Windows windows 怎么永久关闭自动更新
98 天前
回复了 Ritr 创建的主题 程序员 我想请教一下,如何发送鼠标或者键盘事件
你点击控件成功之后,给 A 窗口发送最小化消息 SendMessage(HWND, SC_MINIMIZE)就可以了吧
150 天前
回复了 KaynW 创建的主题 摄影 家用照片打印机有推荐的吗
@capric 6, 8, 10, A4 的相纸都支持,调整进纸仓的卡扣就行
150 天前
回复了 KaynW 创建的主题 摄影 家用照片打印机有推荐的吗
我家用惠普 4160L 喷墨自动双面,打 7 寸彩色照片或者 1 寸证件都很不能,咸鱼上收的,400-500 块,连供墨仓,墨水买兼容的,很便宜
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3138 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 13:39 · PVG 21:39 · LAX 05:39 · JFK 08:39
Developed with CodeLauncher
♥ Do have faith in what you're doing.