pub struct UseCacheUpdate {
pub doc_status: Signal<bool>,
pub version: Signal<String>,
pub updating: Signal<bool>,
}Expand description
Reactive state for the cache update feature.
Tracks the documentation build status, the latest version string, and whether a cache update is currently in progress.
Fields§
§doc_status: Signal<bool>Whether the docs.rs build status indicates documentation is available.
version: Signal<String>The latest version string returned by docs.rs.
updating: Signal<bool>Whether a cache update operation is currently in progress.
Implementations§
Source§impl UseCacheUpdate
Implementation of cache update functionality.
impl UseCacheUpdate
Implementation of cache update functionality.
Sourcepub fn use_cache_state() -> UseCacheUpdate
pub fn use_cache_state() -> UseCacheUpdate
Creates cache update state for tracking documentation build status.
Initializes doc_status to false, version to an empty string,
and updating to false. The actual data is loaded asynchronously
via Self::load.
§Returns
UseCacheUpdate: The cache update state.
Sourcepub fn load(self, current_version: &str, config: Option<BridgeConfig>)
pub fn load(self, current_version: &str, config: Option<BridgeConfig>)
Asynchronously fetches the docs.rs status JSON and invokes the bridge
update_cache command to synchronize the local cache.
First fetches DOCS_STATUS_URL and parses the { "doc_status": bool, "version": string } JSON payload into the provided state signals.
If the remote version is greater than EUV_VERSION and the bridge
is available, invokes the update_cache command via
window.bridge.core.invoke("update_cache") and updates the
updating signal accordingly.
§Arguments
&str: The current version string for comparison.Option<BridgeConfig>: Optional custom bridge configuration.
Source§impl UseCacheUpdate
impl UseCacheUpdate
pub fn get_doc_status(&self) -> Signal<bool>
pub fn get_mut_doc_status(&mut self) -> &mut Signal<bool>
pub fn set_doc_status(&mut self, val: Signal<bool>) -> &mut Self
pub fn get_version(&self) -> Signal<String>
pub fn get_mut_version(&mut self) -> &mut Signal<String>
pub fn set_version(&mut self, val: Signal<String>) -> &mut Self
pub fn get_updating(&self) -> Signal<bool>
pub fn get_mut_updating(&mut self) -> &mut Signal<bool>
pub fn set_updating(&mut self, val: Signal<bool>) -> &mut Self
Trait Implementations§
Source§impl Clone for UseCacheUpdate
impl Clone for UseCacheUpdate
Source§fn clone(&self) -> UseCacheUpdate
fn clone(&self) -> UseCacheUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more