pub enum BinaryCachePolicyKind {
KeepCompatible,
DiscardOnUpgrade,
NeverDiscard,
}Expand description
Built-in binary cache policy variants, selectable via config.
§Config examples
{ "binary_cache_policy": "keep_compatible" }
{ "binary_cache_policy": "discard_on_upgrade" }
{ "binary_cache_policy": "never_discard" }Variants§
KeepCompatible
Keep the cache as long as the current binary satisfies min_binary_version.
Recommended for most apps — opt in via "binary_cache_policy": "keep_compatible".
DiscardOnUpgrade
Discard when current_binary > min_binary_version.
This is the default, preserving pre-0.0.2 semantics.
Note: this detects “binary newer than min”, not actual binary changes (e.g., rebuild at same version, downgrade). True change detection would require persisting the previous binary version (deferred).
NeverDiscard
Never discard based on binary version. Only the safety check
(binary < min) still applies.
Trait Implementations§
Source§impl BinaryCachePolicy for BinaryCachePolicyKind
impl BinaryCachePolicy for BinaryCachePolicyKind
Source§fn should_discard(
&self,
current_binary: &Version,
cached_meta: &HotswapMeta,
_previous_binary: Option<&Version>,
) -> bool
fn should_discard( &self, current_binary: &Version, cached_meta: &HotswapMeta, _previous_binary: Option<&Version>, ) -> bool
Return
true to discard the cached bundle and fall back to embedded assets. Read moreSource§impl Clone for BinaryCachePolicyKind
impl Clone for BinaryCachePolicyKind
Source§fn clone(&self) -> BinaryCachePolicyKind
fn clone(&self) -> BinaryCachePolicyKind
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 BinaryCachePolicyKind
impl Debug for BinaryCachePolicyKind
Source§impl Default for BinaryCachePolicyKind
impl Default for BinaryCachePolicyKind
Source§fn default() -> BinaryCachePolicyKind
fn default() -> BinaryCachePolicyKind
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BinaryCachePolicyKind
impl<'de> Deserialize<'de> for BinaryCachePolicyKind
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
Source§impl PartialEq for BinaryCachePolicyKind
impl PartialEq for BinaryCachePolicyKind
Source§impl Serialize for BinaryCachePolicyKind
impl Serialize for BinaryCachePolicyKind
impl Copy for BinaryCachePolicyKind
impl Eq for BinaryCachePolicyKind
impl StructuralPartialEq for BinaryCachePolicyKind
Auto Trait Implementations§
impl Freeze for BinaryCachePolicyKind
impl RefUnwindSafe for BinaryCachePolicyKind
impl Send for BinaryCachePolicyKind
impl Sync for BinaryCachePolicyKind
impl Unpin for BinaryCachePolicyKind
impl UnsafeUnpin for BinaryCachePolicyKind
impl UnwindSafe for BinaryCachePolicyKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
Source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.