From afe05f3ffa168d12cb925e204a00a589b105f02d Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 2 Jun 2020 12:58:29 +0200 Subject: [PATCH] accessor: use aio Decoder in aio Accessor Signed-off-by: Wolfgang Bumiller --- src/accessor/aio.rs | 2 +- src/decoder/aio.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/accessor/aio.rs b/src/accessor/aio.rs index 009766a..3cedc72 100644 --- a/src/accessor/aio.rs +++ b/src/accessor/aio.rs @@ -13,7 +13,7 @@ use std::sync::Arc; use std::task::{Context, Poll}; use crate::accessor::{self, cache::Cache, ReadAt}; -use crate::decoder::Decoder; +use crate::decoder::aio::Decoder; use crate::format::GoodbyeItem; use crate::poll_fn::poll_fn; use crate::Entry; diff --git a/src/decoder/aio.rs b/src/decoder/aio.rs index 0b50b16..e212c5e 100644 --- a/src/decoder/aio.rs +++ b/src/decoder/aio.rs @@ -51,6 +51,12 @@ impl Decoder { }) } + /// Internal helper for `Accessor`. In this case we have the low-level state machine, and the + /// layer "above" the `Accessor` propagates the actual type (sync vs async). + pub(crate) fn from_impl(inner: decoder::DecoderImpl) -> Self { + Self { inner } + } + /// If this is a directory entry, get the next item inside the directory. pub async fn next(&mut self) -> Option> { self.inner.next_do().await.transpose()