Skip to main content

HookPluginIdentity

Struct HookPluginIdentity 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: &'a str

The plugin id — what Codex records trust and enablement against.

§version: &'a str

Plugin version. Bumping it is how a consumer invalidates the app’s cached copy of an installed plugin.

§description: &'a str

One-line description shown beside the plugin.

§display_name: &'a str

Display name in the plugin UI.

§short_description: &'a str

Short marketplace description.

§long_description: &'a str

Long marketplace description.

§developer_name: &'a str

Developer/author name shown to the user granting hook trust.

Implementations§

Source§

impl<'a> HookPluginIdentity<'a>

Source

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.

Source

pub const fn with_description(self, description: &'a str) -> Self

Set the one-line description shown beside the plugin.

Source

pub const fn with_display_name(self, display_name: &'a str) -> Self

Set the display name shown in the plugin UI.

Source

pub const fn with_short_description(self, short_description: &'a str) -> Self

Set the short marketplace description.

Source

pub const fn with_long_description(self, long_description: &'a str) -> Self

Set the long marketplace description.

Source

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>

Source§

fn clone(&self) -> HookPluginIdentity<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for HookPluginIdentity<'a>

Source§

impl<'a> Debug for HookPluginIdentity<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for HookPluginIdentity<'a>

Source§

impl<'a> PartialEq for HookPluginIdentity<'a>

Source§

fn eq(&self, other: &HookPluginIdentity<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for HookPluginIdentity<'a>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more