29 lines
801 B
Rust
29 lines
801 B
Rust
// 版权所有 (c) ling 保留所有权利。
|
||
// 除非另行说明,否则仅允许在LingTransmit中使用此文件中的代码。
|
||
//
|
||
// 由 ling 创建于 2025/1/19.
|
||
#![allow(non_snake_case)]
|
||
|
||
use async_trait::async_trait;
|
||
use tokio::io::{AsyncRead, AsyncWrite};
|
||
use tokio::net::{tcp, unix};
|
||
|
||
/// 读取抽象
|
||
#[async_trait]
|
||
pub trait OwnedReadHalfAbstraction: AsyncRead + Unpin + Send + Sync {}
|
||
|
||
/// 写入抽象
|
||
#[async_trait]
|
||
pub trait OwnedWriteHalfAbstraction: AsyncWrite + Unpin + Send + Sync {}
|
||
|
||
#[async_trait]
|
||
impl OwnedReadHalfAbstraction for tcp::OwnedReadHalf {}
|
||
|
||
#[async_trait]
|
||
impl OwnedReadHalfAbstraction for unix::OwnedReadHalf {}
|
||
|
||
#[async_trait]
|
||
impl OwnedWriteHalfAbstraction for tcp::OwnedWriteHalf {}
|
||
|
||
#[async_trait]
|
||
impl OwnedWriteHalfAbstraction for unix::OwnedWriteHalf {} |