#[non_exhaustive]pub enum PluginRole {
DetectVersion,
FetchReleases,
ExecuteUpdate,
PreUpdateHook,
PostUpdateHook,
Other(String),
}Expand description
Re-export PluginRole so consumers can construct and match on role values
without a direct uptrakit-shared-types dependency.
Roles that a plugin can fulfill in the version-check / update lifecycle.
Each (host_id, software_item_id) pair may have up to one plugin
assignment per role, enabling mix-and-match plugin configurations
(e.g., APT for detection, GitHub for release fetching).
§Wire forward-compatibility
Other(String) is a catch-all variant for role strings received from a
newer peer that this binary does not yet know about. Serde deserialization
is infallible: an unknown string such as "pre_update_hook" becomes
Other("pre_update_hook") rather than a parse error, allowing older agents
and web-API clients to survive rolling upgrades without dropping entire
messages.
FromStr retains its original error behaviour for known-role contexts
(API validation, URL parameters, database columns) where a caller
explicitly needs to distinguish known variants from unknown ones.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DetectVersion
Detects the installed version on the agent host.
FetchReleases
Fetches the latest available version (controller-side for API plugins, agent-side for local package-index plugins).
ExecuteUpdate
Executes the actual software update on the agent host.
PreUpdateHook
Runs a lifecycle plugin before the update (ordered by ordinal).
PostUpdateHook
Runs a lifecycle plugin after the update (ordered by ordinal).
Other(String)
An unknown plugin role received from a newer peer.
The inner string is the raw snake_case value as it appeared on the wire.
Implementations§
Source§impl PluginRole
impl PluginRole
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the snake_case string representation of this plugin role.
For PluginRole::Other, returns the inner string as-is.
Trait Implementations§
Source§impl Clone for PluginRole
impl Clone for PluginRole
Source§fn clone(&self) -> PluginRole
fn clone(&self) -> PluginRole
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginRole
impl Debug for PluginRole
Source§impl<'de> Deserialize<'de> for PluginRole
impl<'de> Deserialize<'de> for PluginRole
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PluginRole, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<PluginRole, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for PluginRole
impl Display for PluginRole
Source§impl From<String> for PluginRole
impl From<String> for PluginRole
Source§fn from(s: String) -> PluginRole
fn from(s: String) -> PluginRole
Converts a snake_case string to a plugin role.
Unknown strings map to PluginRole::Other rather than failing.
Source§impl FromStr for PluginRole
impl FromStr for PluginRole
Source§type Err = ParsePluginRoleError
type Err = ParsePluginRoleError
Source§fn from_str(s: &str) -> Result<PluginRole, <PluginRole as FromStr>::Err>
fn from_str(s: &str) -> Result<PluginRole, <PluginRole as FromStr>::Err>
s to return a value of this type. Read more