Skip to main content

Host

Struct Host 

Source
pub struct Host {
    pub namespace: String,
    pub command: String,
    pub cargo_package: String,
    pub skills_directory: PathBuf,
}
Expand description

One repository’s identity to this crate.

The fields are public and there is no constructor, so adding one here is a compile error at every host rather than a silent default. There are no invariants to protect: each field is a name this crate repeats back, and a wrong one is visible in the first line of output.

Fields§

§namespace: String

Prefixes every schema identity in a receipt, e.g. playbench in playbench.skill-evidence.record.v1.

§command: String

The binary an operator actually types. Usually, but not necessarily, the same word as namespace.

§cargo_package: String

The Cargo package that provides command, as cargo run -p wants it. Installed skill packages quote it in their runnable examples.

§skills_directory: PathBuf

Where this repository keeps its own skill packages.

Resolve it however the host resolves it — typically from the host’s own CARGO_MANIFEST_DIR at compile time. It is deliberately not derived from the audited --root: lifecycle_self_target_checks_canonical_paths_instead_of_basenames pins that a same-named package in the audited tree is a different package, not a self-target.

Implementations§

Source§

impl Host

Source

pub fn hash_schema(&self) -> String

The schema identity on a hash receipt.

Source

pub fn record_schema(&self) -> String

The schema identity on a record receipt.

Source

pub fn method_gap_inventory_schema(&self) -> String

The schema identity on a method-gap research inventory.

Source

pub fn operator_skill(&self, operator_skill_name: &str) -> PathBuf

The package this repository would be running when it drives operator_skill_name, used to refuse a workflow that targets itself.

Source

pub fn skills_directory(&self) -> &Path

Where this repository keeps its own skill packages.

Source

pub fn recovery_instruction(&self, recovery: Recovery) -> String

Renders the sentence that tells an operator how to finish an operation that stopped part-way.

This is the half of an Error the library deliberately does not write: it knows the action, and only the host knows what to call the binary that performs it.

Trait Implementations§

Source§

impl Clone for Host

Source§

fn clone(&self) -> Self

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 Debug for Host

Source§

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

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

impl Eq for Host

Source§

impl PartialEq for Host

Source§

fn eq(&self, other: &Self) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Host

Auto Trait Implementations§

§

impl Freeze for Host

§

impl RefUnwindSafe for Host

§

impl Send for Host

§

impl Sync for Host

§

impl Unpin for Host

§

impl UnsafeUnpin for Host

§

impl UnwindSafe for Host

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.