pub struct IncrementalGenerator { /* private fields */ }Expand description
Incremental code generator with SHA256-based JIT
Implementations§
Source§impl IncrementalGenerator
impl IncrementalGenerator
Sourcepub fn new(config: IncrementalConfig) -> Self
pub fn new(config: IncrementalConfig) -> Self
Create new incremental generator
Sourcepub fn with_default_config() -> Self
pub fn with_default_config() -> Self
Create with default configuration
Sourcepub fn compute_content_hash(file_path: &Path) -> Result<String>
pub fn compute_content_hash(file_path: &Path) -> Result<String>
Compute SHA256 hash of file content
Sourcepub fn compute_string_hash(content: &str) -> String
pub fn compute_string_hash(content: &str) -> String
Compute SHA256 hash of string (e.g., specification)
Sourcepub fn should_regenerate(
&self,
file_path: &Path,
current_spec_hash: &str,
) -> Result<bool>
pub fn should_regenerate( &self, file_path: &Path, current_spec_hash: &str, ) -> Result<bool>
Check if file should be regenerated
Sourcepub fn store_file_state(
&mut self,
file_path: PathBuf,
spec_hash: &str,
) -> Result<()>
pub fn store_file_state( &mut self, file_path: PathBuf, spec_hash: &str, ) -> Result<()>
Store generated file state in cache
Sourcepub fn check_files(
&self,
files: &[PathBuf],
spec_hash: &str,
) -> Result<Vec<bool>>
pub fn check_files( &self, files: &[PathBuf], spec_hash: &str, ) -> Result<Vec<bool>>
Process a batch of files with incremental checking Returns which files need regeneration
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Get cache size (number of cached files)
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache
Sourcepub fn get_cache(&self) -> &IncrementalCache
pub fn get_cache(&self) -> &IncrementalCache
Get reference to cache (read-only)
Trait Implementations§
Source§impl Default for IncrementalGenerator
impl Default for IncrementalGenerator
Source§fn default() -> IncrementalGenerator
fn default() -> IncrementalGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IncrementalGenerator
impl RefUnwindSafe for IncrementalGenerator
impl Send for IncrementalGenerator
impl Sync for IncrementalGenerator
impl Unpin for IncrementalGenerator
impl UnsafeUnpin for IncrementalGenerator
impl UnwindSafe for IncrementalGenerator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> EvidenceKind for T
impl<T> EvidenceKind for T
default fn kind_label(&self) -> &'static str
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