pub struct DynamicPluginRegistry { /* private fields */ }Expand description
In-memory dynamic plugin registry used by the control plane.
Implementations§
Source§impl DynamicPluginRegistry
impl DynamicPluginRegistry
Sourcepub fn from_records(records: Vec<DynamicPluginRecord>) -> Result<Self>
pub fn from_records(records: Vec<DynamicPluginRecord>) -> Result<Self>
Reconstructs a registry from previously persisted durable records.
Sourcepub fn get(&self, plugin_id: &str) -> Option<&DynamicPluginRecord>
pub fn get(&self, plugin_id: &str) -> Option<&DynamicPluginRecord>
Returns the registered record for plugin_id, if present.
Sourcepub fn list(&self, include_tombstoned: bool) -> Vec<&DynamicPluginRecord>
pub fn list(&self, include_tombstoned: bool) -> Vec<&DynamicPluginRecord>
Lists records, hiding tombstones unless requested.
Sourcepub fn cloned_records(
&self,
include_tombstoned: bool,
) -> Vec<DynamicPluginRecord>
pub fn cloned_records( &self, include_tombstoned: bool, ) -> Vec<DynamicPluginRecord>
Clones records for serialization or higher-level projection.
Sourcepub fn add(
&mut self,
record: DynamicPluginRecord,
) -> Result<&DynamicPluginRecord>
pub fn add( &mut self, record: DynamicPluginRecord, ) -> Result<&DynamicPluginRecord>
Adds a new dynamic plugin record.
This is a trusted internal control-plane API. Callers that start from an
authored relay-plugin.toml manifest should prefer Self::add_manifest
so the manifest contract is enforced before record creation.
Sourcepub fn add_manifest(
&mut self,
manifest: DynamicPluginManifest,
manifest_ref: Option<String>,
) -> Result<&DynamicPluginRecord>
pub fn add_manifest( &mut self, manifest: DynamicPluginManifest, manifest_ref: Option<String>, ) -> Result<&DynamicPluginRecord>
Validates an authored manifest and registers the resulting dynamic plugin record.
Sourcepub fn enable(&mut self, plugin_id: &str) -> Result<bool>
pub fn enable(&mut self, plugin_id: &str) -> Result<bool>
Marks the plugin enabled in desired state.
Sourcepub fn disable(&mut self, plugin_id: &str) -> Result<bool>
pub fn disable(&mut self, plugin_id: &str) -> Result<bool>
Marks the plugin disabled in desired state.
Sourcepub fn remove(&mut self, plugin_id: &str) -> Result<bool>
pub fn remove(&mut self, plugin_id: &str) -> Result<bool>
Tombstones the plugin record and disables desired runtime realization.
Sourcepub fn update_validation_status(
&mut self,
plugin_id: &str,
validation: DynamicPluginValidationStatus,
) -> Result<()>
pub fn update_validation_status( &mut self, plugin_id: &str, validation: DynamicPluginValidationStatus, ) -> Result<()>
Replaces the current validation status without mutating desired state.
Sourcepub fn update_runtime_status(
&mut self,
plugin_id: &str,
runtime: DynamicPluginRuntimeStatus,
) -> Result<()>
pub fn update_runtime_status( &mut self, plugin_id: &str, runtime: DynamicPluginRuntimeStatus, ) -> Result<()>
Replaces the current runtime status without mutating desired state.
Sourcepub fn update_last_error(
&mut self,
plugin_id: &str,
last_error: Option<DynamicPluginFailure>,
) -> Result<()>
pub fn update_last_error( &mut self, plugin_id: &str, last_error: Option<DynamicPluginFailure>, ) -> Result<()>
Records the most recent dynamic-plugin failure summary.
Sourcepub fn update_environment(
&mut self,
plugin_id: &str,
environment_ref: Option<String>,
environment: DynamicPluginCheckState,
) -> Result<()>
pub fn update_environment( &mut self, plugin_id: &str, environment_ref: Option<String>, environment: DynamicPluginCheckState, ) -> Result<()>
Replaces the resolved worker environment and its validation state.
Sourcepub fn update_policy_status(
&mut self,
plugin_id: &str,
policy_satisfied: DynamicPluginCheckState,
startup_class: DynamicPluginStartupClass,
attestation_mode: DynamicPluginAttestationMode,
last_error: Option<DynamicPluginFailure>,
) -> Result<()>
pub fn update_policy_status( &mut self, plugin_id: &str, policy_satisfied: DynamicPluginCheckState, startup_class: DynamicPluginStartupClass, attestation_mode: DynamicPluginAttestationMode, last_error: Option<DynamicPluginFailure>, ) -> Result<()>
Replaces the current host-policy outcome without mutating desired state.
Trait Implementations§
Source§impl Debug for DynamicPluginRegistry
impl Debug for DynamicPluginRegistry
Source§impl Default for DynamicPluginRegistry
impl Default for DynamicPluginRegistry
Source§fn default() -> DynamicPluginRegistry
fn default() -> DynamicPluginRegistry
Auto Trait Implementations§
impl Freeze for DynamicPluginRegistry
impl RefUnwindSafe for DynamicPluginRegistry
impl Send for DynamicPluginRegistry
impl Sync for DynamicPluginRegistry
impl Unpin for DynamicPluginRegistry
impl UnsafeUnpin for DynamicPluginRegistry
impl UnwindSafe for DynamicPluginRegistry
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request