|
|
@ -57,6 +57,9 @@ use err::{
|
|
|
|
#[repr(transparent)]
|
|
|
|
#[repr(transparent)]
|
|
|
|
struct MappedSlice(UniqueSlice<u8>);
|
|
|
|
struct MappedSlice(UniqueSlice<u8>);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsafe impl Send for MappedSlice{}
|
|
|
|
|
|
|
|
unsafe impl Sync for MappedSlice{}
|
|
|
|
|
|
|
|
|
|
|
|
impl ops::Drop for MappedSlice
|
|
|
|
impl ops::Drop for MappedSlice
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#[inline]
|
|
|
|
#[inline]
|
|
|
@ -631,6 +634,24 @@ impl<T> BorrowMut<[u8]> for MappedFile<T>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl<T> AsRef<[u8]> for MappedFile<T>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
|
|
|
|
fn as_ref(&self) -> &[u8]
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
self.as_slice()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl<T> AsMut<[u8]> for MappedFile<T>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
|
|
|
|
fn as_mut(&mut self) -> &mut [u8]
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
self.as_slice_mut()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl<T> ops::Deref for MappedFile<T>
|
|
|
|
impl<T> ops::Deref for MappedFile<T>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type Target= [u8];
|
|
|
|
type Target= [u8];
|
|
|
|