pub struct HostedMockPlugin {
pub id: Uuid,
pub deployment_id: Uuid,
pub plugin_id: Uuid,
pub plugin_version_id: Uuid,
pub config_json: Value,
pub permissions_json: Value,
pub enabled: bool,
pub attached_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub attached_by: Option<Uuid>,
}Fields§
§id: Uuid§deployment_id: Uuid§plugin_id: Uuid§plugin_version_id: Uuid§config_json: Value§permissions_json: Value§enabled: bool§attached_at: DateTime<Utc>§updated_at: DateTime<Utc>§attached_by: Option<Uuid>Implementations§
Source§impl HostedMockPlugin
impl HostedMockPlugin
Sourcepub async fn attach(
pool: &Pool<Postgres>,
input: AttachHostedMockPlugin<'_>,
) -> Result<HostedMockPlugin, Error>
pub async fn attach( pool: &Pool<Postgres>, input: AttachHostedMockPlugin<'_>, ) -> Result<HostedMockPlugin, Error>
Attach (or re-attach) a plugin to a deployment. UPSERT on the
(deployment_id, plugin_id) UNIQUE constraint — re-attach of
the same plugin updates the version, config, and grant.
pub async fn find_by_id( pool: &Pool<Postgres>, id: Uuid, ) -> Result<Option<HostedMockPlugin>, Error>
pub async fn list_by_deployment( pool: &Pool<Postgres>, deployment_id: Uuid, ) -> Result<Vec<HostedMockPlugin>, Error>
Sourcepub async fn list_enabled_by_deployment(
pool: &Pool<Postgres>,
deployment_id: Uuid,
) -> Result<Vec<HostedMockPlugin>, Error>
pub async fn list_enabled_by_deployment( pool: &Pool<Postgres>, deployment_id: Uuid, ) -> Result<Vec<HostedMockPlugin>, Error>
Enabled-only listing. The plugin-host calls this on boot to build its load manifest.
pub async fn count_active_by_deployment( pool: &Pool<Postgres>, deployment_id: Uuid, ) -> Result<i64, Error>
Sourcepub async fn set_enabled(
pool: &Pool<Postgres>,
id: Uuid,
enabled: bool,
) -> Result<Option<HostedMockPlugin>, Error>
pub async fn set_enabled( pool: &Pool<Postgres>, id: Uuid, enabled: bool, ) -> Result<Option<HostedMockPlugin>, Error>
Soft toggle. Detach (hard delete) is delete.
Trait Implementations§
Source§impl Clone for HostedMockPlugin
impl Clone for HostedMockPlugin
Source§fn clone(&self) -> HostedMockPlugin
fn clone(&self) -> HostedMockPlugin
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HostedMockPlugin
impl Debug for HostedMockPlugin
Source§impl<'de> Deserialize<'de> for HostedMockPlugin
impl<'de> Deserialize<'de> for HostedMockPlugin
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HostedMockPlugin, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HostedMockPlugin, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<HostedMockPlugin> for AttachmentResponse
impl From<HostedMockPlugin> for AttachmentResponse
Source§fn from(row: HostedMockPlugin) -> Self
fn from(row: HostedMockPlugin) -> Self
Converts to this type from the input type.
Source§impl<'a, R> FromRow<'a, R> for HostedMockPluginwhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Value: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
bool: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Uuid>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
impl<'a, R> FromRow<'a, R> for HostedMockPluginwhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Value: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
bool: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Uuid>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Source§impl Serialize for HostedMockPlugin
impl Serialize for HostedMockPlugin
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,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for HostedMockPlugin
impl RefUnwindSafe for HostedMockPlugin
impl Send for HostedMockPlugin
impl Sync for HostedMockPlugin
impl Unpin for HostedMockPlugin
impl UnsafeUnpin for HostedMockPlugin
impl UnwindSafe for HostedMockPlugin
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.