#[non_exhaustive]pub enum EditBacking {
Bounded,
Mirrored,
}Expand description
Which of the two read-write backends a file’s editing session is actually
using, from File::edit_backing.
Deliberately a different type from MemoryStrategy: that one is what a
caller asks for and includes Auto, which is a
preference between these two rather than a third thing a session can be. A
single shared type would make file.backing() == Auto a comparison that
compiles and is false forever.
The two also evolve at different rates. A future MemoryStrategy may name a
new policy — a byte budget, a size threshold — without the set of backends
changing at all. Sealed for the rarer case that a third backend does appear.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bounded
Reads through a file handle, holding only what a commit is building. Memory does not scale with the file.
Mirrored
Holds the whole file in memory for the life of the session.
Trait Implementations§
Source§impl Clone for EditBacking
impl Clone for EditBacking
Source§fn clone(&self) -> EditBacking
fn clone(&self) -> EditBacking
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EditBacking
Source§impl Debug for EditBacking
impl Debug for EditBacking
impl Eq for EditBacking
Source§impl From<EditBacking> for MemoryStrategy
impl From<EditBacking> for MemoryStrategy
Source§fn from(backing: EditBacking) -> Self
fn from(backing: EditBacking) -> Self
Turns an outcome back into the request that pins it, so a caller can
reopen a file onto the backing it got the first time:
with_memory_strategy(file.edit_backing().unwrap().into()).
Source§impl PartialEq for EditBacking
impl PartialEq for EditBacking
impl StructuralPartialEq for EditBacking
Auto Trait Implementations§
impl Freeze for EditBacking
impl RefUnwindSafe for EditBacking
impl Send for EditBacking
impl Sync for EditBacking
impl Unpin for EditBacking
impl UnsafeUnpin for EditBacking
impl UnwindSafe for EditBacking
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
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>
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>
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