#[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 (const: unstable) · 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
impl Eq 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 moreSource§impl Hash for PluginRole
impl Hash for PluginRole
Source§impl PartialEq for PluginRole
impl PartialEq for PluginRole
Source§impl Serialize for PluginRole
impl Serialize for PluginRole
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 PluginRole
Auto Trait Implementations§
impl Freeze for PluginRole
impl RefUnwindSafe for PluginRole
impl Send for PluginRole
impl Sync for PluginRole
impl Unpin for PluginRole
impl UnsafeUnpin for PluginRole
impl UnwindSafe for PluginRole
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more