diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-01-24 15:10:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-24 15:10:49 -0500 |
commit | 5e32c5ea448563be91017d71bab060c8a6bd90fe (patch) | |
tree | aa9e731b9f4b9f6bc28beab23e7575d43bc14653 /core/examples | |
parent | 86726f88f1b6fd168fbd5b0d7e01b027cfc268ac (diff) |
s/PinnedBuf/ZeroCopyBuf (#3782)
Diffstat (limited to 'core/examples')
-rw-r--r-- | core/examples/http_bench.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/examples/http_bench.rs b/core/examples/http_bench.rs index 5a5b43c51..8151c4575 100644 --- a/core/examples/http_bench.rs +++ b/core/examples/http_bench.rs @@ -108,12 +108,12 @@ fn test_record_from() { pub type HttpOp = dyn Future<Output = Result<i32, std::io::Error>> + Send; pub type HttpOpHandler = - fn(record: Record, zero_copy_buf: Option<PinnedBuf>) -> Pin<Box<HttpOp>>; + fn(record: Record, zero_copy_buf: Option<ZeroCopyBuf>) -> Pin<Box<HttpOp>>; fn http_op( handler: HttpOpHandler, -) -> impl Fn(&[u8], Option<PinnedBuf>) -> CoreOp { - move |control: &[u8], zero_copy_buf: Option<PinnedBuf>| -> CoreOp { +) -> impl Fn(&[u8], Option<ZeroCopyBuf>) -> CoreOp { + move |control: &[u8], zero_copy_buf: Option<ZeroCopyBuf>| -> CoreOp { let record = Record::from(control); let is_sync = record.promise_id == 0; let op = handler(record.clone(), zero_copy_buf); @@ -232,7 +232,7 @@ impl Future for Accept { fn op_accept( record: Record, - _zero_copy_buf: Option<PinnedBuf>, + _zero_copy_buf: Option<ZeroCopyBuf>, ) -> Pin<Box<HttpOp>> { let rid = record.arg as u32; debug!("accept {}", rid); @@ -250,7 +250,7 @@ fn op_accept( fn op_listen( _record: Record, - _zero_copy_buf: Option<PinnedBuf>, + _zero_copy_buf: Option<ZeroCopyBuf>, ) -> Pin<Box<HttpOp>> { debug!("listen"); let fut = async { @@ -266,7 +266,7 @@ fn op_listen( fn op_close( record: Record, - _zero_copy_buf: Option<PinnedBuf>, + _zero_copy_buf: Option<ZeroCopyBuf>, ) -> Pin<Box<HttpOp>> { debug!("close"); let fut = async move { @@ -282,7 +282,7 @@ fn op_close( struct Read { rid: ResourceId, - buf: PinnedBuf, + buf: ZeroCopyBuf, } impl Future for Read { @@ -304,7 +304,7 @@ impl Future for Read { fn op_read( record: Record, - zero_copy_buf: Option<PinnedBuf>, + zero_copy_buf: Option<ZeroCopyBuf>, ) -> Pin<Box<HttpOp>> { let rid = record.arg as u32; debug!("read rid={}", rid); @@ -325,7 +325,7 @@ fn op_read( struct Write { rid: ResourceId, - buf: PinnedBuf, + buf: ZeroCopyBuf, } impl Future for Write { @@ -347,7 +347,7 @@ impl Future for Write { fn op_write( record: Record, - zero_copy_buf: Option<PinnedBuf>, + zero_copy_buf: Option<ZeroCopyBuf>, ) -> Pin<Box<HttpOp>> { let rid = record.arg as u32; debug!("write rid={}", rid); |