Move impl block to correct location
This commit is contained in:
parent
53015e116f
commit
5338ff81a5
1 changed files with 13 additions and 13 deletions
26
src/cache/fs.rs
vendored
26
src/cache/fs.rs
vendored
|
@ -152,19 +152,6 @@ impl<R> EncryptedReader<R> {
|
|||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait MetadataFetch: AsyncBufRead {
|
||||
async fn metadata(mut self: Pin<&mut Self>) -> Result<ImageMetadata, ()>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<R: AsyncBufRead + Send> MetadataFetch for R {
|
||||
#[inline]
|
||||
async fn metadata(mut self: Pin<&mut Self>) -> Result<ImageMetadata, ()> {
|
||||
MetadataFuture(self).await
|
||||
}
|
||||
}
|
||||
|
||||
impl<R: AsyncRead> AsyncRead for EncryptedReader<R> {
|
||||
fn poll_read(
|
||||
mut self: Pin<&mut Self>,
|
||||
|
@ -181,6 +168,19 @@ impl<R: AsyncRead> AsyncRead for EncryptedReader<R> {
|
|||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait MetadataFetch: AsyncBufRead {
|
||||
async fn metadata(mut self: Pin<&mut Self>) -> Result<ImageMetadata, ()>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<R: AsyncBufRead + Send> MetadataFetch for R {
|
||||
#[inline]
|
||||
async fn metadata(mut self: Pin<&mut Self>) -> Result<ImageMetadata, ()> {
|
||||
MetadataFuture(self).await
|
||||
}
|
||||
}
|
||||
|
||||
struct MetadataFuture<'a, R>(Pin<&'a mut R>);
|
||||
|
||||
impl<'a, R: AsyncBufRead> Future for MetadataFuture<'a, R> {
|
||||
|
|
Loading…
Reference in a new issue