pub struct FileCompressionState {
pub files: HashMap<PathBuf, FileCompressionRecord>,
}Expand description
Set of file compression records tracked for a session.
Fields§
§files: HashMap<PathBuf, FileCompressionRecord>Implementations§
Source§impl FileCompressionState
impl FileCompressionState
pub fn new() -> Self
Sourcepub fn record_read(&mut self, path: &Path, content: &str, turn: usize)
pub fn record_read(&mut self, path: &Path, content: &str, turn: usize)
Record a file read at the given turn, setting level to Full.
If the content has changed since the last record, the level is
reset to Full (stale summaries must be discarded). If unchanged,
the existing level is preserved but the turn marker is updated.
Sourcepub fn demote(
&mut self,
path: &Path,
level: CompressionLevel,
current_turn: usize,
) -> bool
pub fn demote( &mut self, path: &Path, level: CompressionLevel, current_turn: usize, ) -> bool
Demote a file’s compression level, unless it is currently protected.
Trait Implementations§
Source§impl Clone for FileCompressionState
impl Clone for FileCompressionState
Source§fn clone(&self) -> FileCompressionState
fn clone(&self) -> FileCompressionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileCompressionState
impl Debug for FileCompressionState
Source§impl Default for FileCompressionState
impl Default for FileCompressionState
Source§fn default() -> FileCompressionState
fn default() -> FileCompressionState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FileCompressionState
impl<'de> Deserialize<'de> for FileCompressionState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FileCompressionState
impl RefUnwindSafe for FileCompressionState
impl Send for FileCompressionState
impl Sync for FileCompressionState
impl Unpin for FileCompressionState
impl UnsafeUnpin for FileCompressionState
impl UnwindSafe for FileCompressionState
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