pub struct Configuration { /* private fields */ }Expand description
Fully resolved crawler configuration.
Unlike the interface’s non-optional storage getter, core exposes an optional client because it
cannot depend on millipede-storage-memory without a dependency cycle. The crawler builder
takes the client from CrawlerBuilder::storage_client or Configuration::storage_client and
returns CrawlerBuildError::MissingStorage when neither is set; default in-memory wiring lives
with the umbrella crate’s examples.
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn builder() -> ConfigurationBuilder
pub fn builder() -> ConfigurationBuilder
Creates an empty configuration builder.
Sourcepub fn default_dataset_id(&self) -> &str
pub fn default_dataset_id(&self) -> &str
Returns the default dataset identifier.
Sourcepub fn default_key_value_store_id(&self) -> &str
pub fn default_key_value_store_id(&self) -> &str
Returns the default key-value store identifier.
Sourcepub fn default_request_queue_id(&self) -> &str
pub fn default_request_queue_id(&self) -> &str
Returns the default request queue identifier.
Sourcepub fn storage_dir(&self) -> &Path
pub fn storage_dir(&self) -> &Path
Returns the storage directory.
Sourcepub fn max_used_cpu_ratio(&self) -> Option<f32>
pub fn max_used_cpu_ratio(&self) -> Option<f32>
Returns the maximum used CPU ratio, when configured.
Sourcepub fn available_memory_ratio(&self) -> Option<f32>
pub fn available_memory_ratio(&self) -> Option<f32>
Returns the available memory ratio, when configured.
Sourcepub fn memory_bytes(&self) -> Option<u64>
pub fn memory_bytes(&self) -> Option<u64>
Returns the memory limit in bytes, when configured.
Sourcepub fn persist_state_interval(&self) -> Duration
pub fn persist_state_interval(&self) -> Duration
Returns the interval between state persistence events.
Sourcepub fn purge_on_start(&self) -> bool
pub fn purge_on_start(&self) -> bool
Returns whether storage is purged at startup.
Sourcepub fn storage_client(&self) -> Option<&Arc<dyn StorageClient>>
pub fn storage_client(&self) -> Option<&Arc<dyn StorageClient>>
Returns the configured storage client, when one was injected.