impl ReaderTrait for Arc
This commit is contained in:
parent
67f310f481
commit
abc634d052
@ -1,4 +1,8 @@
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::{
|
||||
mem::{align_of, size_of},
|
||||
ops::Deref,
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use zerocopy::{FromBytes, FromZeroes, Ref};
|
||||
|
||||
@ -20,3 +24,12 @@ pub trait ReaderTrait {
|
||||
.into_ref()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> ReaderTrait for Arc<T>
|
||||
where
|
||||
T: ReaderTrait,
|
||||
{
|
||||
fn read_raw(&self, range: FileRange) -> &[u8] {
|
||||
self.deref().read_raw(range)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user