pub struct TempFile<T: Send + Clone + Sized> { /* private fields */ }Expand description
Internal struct for handling in-memory files
Implementations§
Source§impl<T: Send + Clone + Sized> TempFile<T>
impl<T: Send + Clone + Sized> TempFile<T>
Sourcepub fn create<N: AsRef<str>>(name: N) -> TypedResult<Self>
pub fn create<N: AsRef<str>>(name: N) -> TypedResult<Self>
Creates an in-memory file
Sourcepub fn seal_read_only(&self) -> TypedResult<TypedMmapMut<'_, T>>
pub fn seal_read_only(&self) -> TypedResult<TypedMmapMut<'_, T>>
Set the TempFile to read-only (prevents further seal modifications)
Sourcepub fn write(&self, value: &T) -> TypedResult<()>
pub fn write(&self, value: &T) -> TypedResult<()>
Writes value to the TempFile (overwrites existing data, but does not clean)
Sourcepub fn read(&self) -> TypedResult<T>
pub fn read(&self) -> TypedResult<T>
Returns all of the TempFile’s data
Sourcepub fn get_typed_mmap_mut(&self) -> TypedResult<TypedMmapMut<'_, T>>
pub fn get_typed_mmap_mut(&self) -> TypedResult<TypedMmapMut<'_, T>>
Returns a mutable memory map from a TempFile
Sourcepub fn get_typed_mmap(&self) -> TypedResult<TypedMmap<'_, T>>
pub fn get_typed_mmap(&self) -> TypedResult<TypedMmap<'_, T>>
Returns a memory map from a TemplFile
Trait Implementations§
impl<T: Copy + Send + Clone + Sized> Copy for TempFile<T>
Auto Trait Implementations§
impl<T> Freeze for TempFile<T>
impl<T> RefUnwindSafe for TempFile<T>where
T: RefUnwindSafe,
impl<T> Send for TempFile<T>
impl<T> Sync for TempFile<T>where
T: Sync,
impl<T> Unpin for TempFile<T>where
T: Unpin,
impl<T> UnwindSafe for TempFile<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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