feat(tvix/castore/blobsvc): BlobReader for more trivial types

Change-Id: I80e4f26c41a504fa4c6a013c2a1e76de613ba294
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11078
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-03-02 17:59:30 +02:00 committed by flokli
parent 982459d343
commit 53fb9ff4c6

View file

@ -77,5 +77,7 @@ pub trait BlobWriter: tokio::io::AsyncWrite + Send + Unpin {
pub trait BlobReader: tokio::io::AsyncRead + tokio::io::AsyncSeek + Send + Unpin + 'static {} pub trait BlobReader: tokio::io::AsyncRead + tokio::io::AsyncSeek + Send + Unpin + 'static {}
/// A [`io::Cursor<Vec<u8>>`] can be used as a BlobReader. /// A [`io::Cursor<Vec<u8>>`] can be used as a BlobReader.
impl BlobReader for io::Cursor<&'static [u8]> {}
impl BlobReader for io::Cursor<&'static [u8; 0]> {}
impl BlobReader for io::Cursor<Vec<u8>> {} impl BlobReader for io::Cursor<Vec<u8>> {}
impl BlobReader for tokio::fs::File {} impl BlobReader for tokio::fs::File {}