Struct a653rs_linux_core::file::TempFile
source · 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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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