#[non_exhaustive]pub enum UpdateCategory {
Security,
Bugfix,
Feature,
Unknown,
Other(String),
}Expand description
Classification of a software update by its nature.
Plugins that can determine the update type (e.g. APT can detect
security updates from the repository URL) set the category on
[UpstreamRelease]. Unknown is used when the plugin cannot classify.
§Wire forward-compatibility
Other(String) is a catch-all variant for category strings received from a
newer peer that this binary does not yet know about. Serde deserialization
is infallible: an unknown string becomes Other(...) rather than a parse
error, allowing older clients to survive rolling upgrades without dropping
entire messages.
FromStr remains strict for URL parameters and DB lookups where callers
need to distinguish known variants from unknown ones.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Security
A security patch or vulnerability fix.
Bugfix
A bug fix that does not address a security vulnerability.
Feature
A new feature or enhancement.
Unknown
The update type could not be determined.
Other(String)
An unknown category received from a newer peer.
The inner string is the raw snake_case value as it appeared on the wire.
Implementations§
Source§impl UpdateCategory
impl UpdateCategory
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the string representation.
For UpdateCategory::Other, returns the inner string as-is.
Trait Implementations§
Source§impl Clone for UpdateCategory
impl Clone for UpdateCategory
Source§fn clone(&self) -> UpdateCategory
fn clone(&self) -> UpdateCategory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UpdateCategory
impl Debug for UpdateCategory
Source§impl Default for UpdateCategory
impl Default for UpdateCategory
Source§fn default() -> UpdateCategory
fn default() -> UpdateCategory
Source§impl<'de> Deserialize<'de> for UpdateCategory
impl<'de> Deserialize<'de> for UpdateCategory
Source§fn deserialize<D>(
deserializer: D,
) -> Result<UpdateCategory, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<UpdateCategory, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for UpdateCategory
impl Display for UpdateCategory
impl Eq for UpdateCategory
Source§impl From<String> for UpdateCategory
impl From<String> for UpdateCategory
Source§fn from(s: String) -> UpdateCategory
fn from(s: String) -> UpdateCategory
Converts a snake_case string to an update category.
Unknown strings map to UpdateCategory::Other rather than failing.
Source§impl FromStr for UpdateCategory
impl FromStr for UpdateCategory
Source§type Err = ParseUpdateCategoryError
type Err = ParseUpdateCategoryError
Source§fn from_str(s: &str) -> Result<UpdateCategory, <UpdateCategory as FromStr>::Err>
fn from_str(s: &str) -> Result<UpdateCategory, <UpdateCategory as FromStr>::Err>
s to return a value of this type. Read moreSource§impl PartialEq for UpdateCategory
impl PartialEq for UpdateCategory
Source§impl Serialize for UpdateCategory
impl Serialize for UpdateCategory
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for UpdateCategory
Auto Trait Implementations§
impl Freeze for UpdateCategory
impl RefUnwindSafe for UpdateCategory
impl Send for UpdateCategory
impl Sync for UpdateCategory
impl Unpin for UpdateCategory
impl UnsafeUnpin for UpdateCategory
impl UnwindSafe for UpdateCategory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.