pub struct MmapedFile { /* private fields */ }
Implementations§
Source§impl MmapedFile
impl MmapedFile
Sourcepub unsafe fn new<P: AsRef<Path>>(p: P) -> Result<Self>
pub unsafe fn new<P: AsRef<Path>>(p: P) -> Result<Self>
Creates a wrapper around a memory mapped file from which you can retrieve
tensors using MmapedFile::deserialize
§Safety
The unsafe is inherited from memmap2::MmapOptions
.
pub fn deserialize(&self) -> Result<SafeTensors<'_>>
Auto Trait Implementations§
impl Freeze for MmapedFile
impl RefUnwindSafe for MmapedFile
impl Send for MmapedFile
impl Sync for MmapedFile
impl Unpin for MmapedFile
impl UnwindSafe for MmapedFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more