pub struct GenerationCache { /* private fields */ }Expand description
Represents the cached state of a generation run
Implementations§
Source§impl GenerationCache
impl GenerationCache
Sourcepub fn new(
commands: &[CommandInfo],
structs: &HashMap<String, StructInfo>,
events: &[EventInfo],
config: &GenerateConfig,
) -> Result<Self, CacheError>
pub fn new( commands: &[CommandInfo], structs: &HashMap<String, StructInfo>, events: &[EventInfo], config: &GenerateConfig, ) -> Result<Self, CacheError>
Create a new cache from current generation state
Sourcepub fn new_with_external_index(
commands: &[CommandInfo],
structs: &HashMap<String, StructInfo>,
events: &[EventInfo],
config: &GenerateConfig,
external_type_index: HashMap<String, Option<PathBuf>>,
) -> Result<Self, CacheError>
pub fn new_with_external_index( commands: &[CommandInfo], structs: &HashMap<String, StructInfo>, events: &[EventInfo], config: &GenerateConfig, external_type_index: HashMap<String, Option<PathBuf>>, ) -> Result<Self, CacheError>
Like new, but persists the external-crate type lookup index so the next
run can seed CommandAnalyzer and skip the registry walk for previously
resolved types (#87). The index does not participate in combined_hash.
Sourcepub fn external_type_index(&self) -> &HashMap<String, Option<PathBuf>>
pub fn external_type_index(&self) -> &HashMap<String, Option<PathBuf>>
The persisted external-crate type lookup index, for seeding the analyzer at the start of a subsequent run.
Sourcepub fn needs_regeneration<P: AsRef<Path>>(
output_dir: P,
commands: &[CommandInfo],
structs: &HashMap<String, StructInfo>,
events: &[EventInfo],
config: &GenerateConfig,
) -> Result<bool, CacheError>
pub fn needs_regeneration<P: AsRef<Path>>( output_dir: P, commands: &[CommandInfo], structs: &HashMap<String, StructInfo>, events: &[EventInfo], config: &GenerateConfig, ) -> Result<bool, CacheError>
Check if generation is needed by comparing with previous cache
Trait Implementations§
Source§impl Debug for GenerationCache
impl Debug for GenerationCache
Source§impl<'de> Deserialize<'de> for GenerationCache
impl<'de> Deserialize<'de> for GenerationCache
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 GenerationCache
impl RefUnwindSafe for GenerationCache
impl Send for GenerationCache
impl Sync for GenerationCache
impl Unpin for GenerationCache
impl UnsafeUnpin for GenerationCache
impl UnwindSafe for GenerationCache
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