#[non_exhaustive]pub struct HookPluginIdentity<'a> {
pub name: &'a str,
pub version: &'a str,
pub description: &'a str,
pub display_name: &'a str,
pub short_description: &'a str,
pub long_description: &'a str,
pub developer_name: &'a str,
}Expand description
The consumer-supplied identity a rendered plugin manifest presents to the user in Codex’s plugin UI.
All fields are plain strings; render_plugin_manifest JSON-escapes them,
so quotes and backslashes in any field are safe.
Build one with HookPluginIdentity::new and the with_* setters. The
fields stay public — reading and patching one is useful, and the fixture
oracle style elsewhere in the crate relies on it — but the type is
#[non_exhaustive], so a struct literal only compiles inside this crate.
Without the constructor a downstream installer got E0639 and could not call
render_plugin_manifest at all, which is the whole public point of the
module.
§Examples
use tapes_harnesses::plugin::codex_app::{HookPluginIdentity, render_plugin_manifest};
let identity = HookPluginIdentity::new("acme-codex", "0.1.0")
.with_display_name("Acme for Codex")
.with_developer_name("Acme");
let manifest = render_plugin_manifest(&identity);
assert!(!manifest.contains("__TAPES_"));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: &'a strThe plugin id — what Codex records trust and enablement against.
version: &'a strPlugin version. Bumping it is how a consumer invalidates the app’s cached copy of an installed plugin.
description: &'a strOne-line description shown beside the plugin.
display_name: &'a strDisplay name in the plugin UI.
short_description: &'a strShort marketplace description.
long_description: &'a strLong marketplace description.
developer_name: &'a strDeveloper/author name shown to the user granting hook trust.
Implementations§
Source§impl<'a> HookPluginIdentity<'a>
impl<'a> HookPluginIdentity<'a>
Sourcepub const fn new(name: &'a str, version: &'a str) -> Self
pub const fn new(name: &'a str, version: &'a str) -> Self
A hook plugin’s identity, from the two fields that carry meaning beyond presentation.
name is what Codex records trust and enablement against, and
version is how a consumer invalidates the app’s cached copy of an
installed plugin — get either wrong and an install misbehaves, so they
are the arguments rather than defaults.
The five remaining fields are strings Codex only shows, and each
starts as name. That default is deliberate: every slot in
PLUGIN_MANIFEST_TEMPLATE must be filled or a literal
__TAPES_PLUGIN_… string appears in the user-facing plugin UI, so the
worst outcome of a forgotten with_* call is a repetitive UI, never a
blank field and never a leaked slot. Override each with its setter.
Sourcepub const fn with_description(self, description: &'a str) -> Self
pub const fn with_description(self, description: &'a str) -> Self
Set the one-line description shown beside the plugin.
Sourcepub const fn with_display_name(self, display_name: &'a str) -> Self
pub const fn with_display_name(self, display_name: &'a str) -> Self
Set the display name shown in the plugin UI.
Sourcepub const fn with_short_description(self, short_description: &'a str) -> Self
pub const fn with_short_description(self, short_description: &'a str) -> Self
Set the short marketplace description.
Sourcepub const fn with_long_description(self, long_description: &'a str) -> Self
pub const fn with_long_description(self, long_description: &'a str) -> Self
Set the long marketplace description.
Sourcepub const fn with_developer_name(self, developer_name: &'a str) -> Self
pub const fn with_developer_name(self, developer_name: &'a str) -> Self
Set the developer/author name shown to the user granting hook trust.
Trait Implementations§
Source§impl<'a> Clone for HookPluginIdentity<'a>
impl<'a> Clone for HookPluginIdentity<'a>
Source§fn clone(&self) -> HookPluginIdentity<'a>
fn clone(&self) -> HookPluginIdentity<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for HookPluginIdentity<'a>
Source§impl<'a> Debug for HookPluginIdentity<'a>
impl<'a> Debug for HookPluginIdentity<'a>
impl<'a> Eq for HookPluginIdentity<'a>
Source§impl<'a> PartialEq for HookPluginIdentity<'a>
impl<'a> PartialEq for HookPluginIdentity<'a>
impl<'a> StructuralPartialEq for HookPluginIdentity<'a>
Auto Trait Implementations§
impl<'a> Freeze for HookPluginIdentity<'a>
impl<'a> RefUnwindSafe for HookPluginIdentity<'a>
impl<'a> Send for HookPluginIdentity<'a>
impl<'a> Sync for HookPluginIdentity<'a>
impl<'a> Unpin for HookPluginIdentity<'a>
impl<'a> UnsafeUnpin for HookPluginIdentity<'a>
impl<'a> UnwindSafe for HookPluginIdentity<'a>
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,
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.