mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
chore: migrate from pin-project to pin-project-lite (#1778)
This commit is contained in:
@@ -8,24 +8,26 @@ use bytes::BytesMut;
|
||||
use futures_core::{ready, Stream};
|
||||
use futures_sink::Sink;
|
||||
use log::trace;
|
||||
use pin_project::pin_project;
|
||||
use pin_project_lite::pin_project;
|
||||
use std::fmt;
|
||||
use std::io::{self, BufRead, Read};
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
/// A `Sink` of frames encoded to an `AsyncWrite`.
|
||||
#[pin_project]
|
||||
pub struct FramedWrite<T, E> {
|
||||
#[pin]
|
||||
inner: FramedWrite2<Fuse<T, E>>,
|
||||
pin_project! {
|
||||
/// A `Sink` of frames encoded to an `AsyncWrite`.
|
||||
pub struct FramedWrite<T, E> {
|
||||
#[pin]
|
||||
inner: FramedWrite2<Fuse<T, E>>,
|
||||
}
|
||||
}
|
||||
|
||||
#[pin_project]
|
||||
pub(crate) struct FramedWrite2<T> {
|
||||
#[pin]
|
||||
inner: T,
|
||||
buffer: BytesMut,
|
||||
pin_project! {
|
||||
pub(crate) struct FramedWrite2<T> {
|
||||
#[pin]
|
||||
inner: T,
|
||||
buffer: BytesMut,
|
||||
}
|
||||
}
|
||||
|
||||
const INITIAL_CAPACITY: usize = 8 * 1024;
|
||||
|
||||
Reference in New Issue
Block a user