pub struct HostCallContext {
pub plugin: String,
pub plugin_version: String,
pub source: PackageSource,
pub entry: String,
pub session_id: Option<String>,
pub project_root: Option<PathBuf>,
pub cwd: PathBuf,
pub via: String,
pub agent_depth: u32,
pub cancel: CancellationToken,
}Expand description
Who calls a host function, from where; the host decides on it whether the call goes ahead.
Fields§
§plugin: StringThe name the package gives itself: any installed package can take
one, so source is what tells the host’s own package from it.
plugin_version: String§source: PackageSource§entry: StringThe command’s name, or the function’s.
session_id: Option<String>§project_root: Option<PathBuf>§cwd: PathBuf§via: StringWho ran the plugin code: model, user (a /name command),
skill, RunCode or host.
agent_depth: u32§cancel: CancellationTokenFires when the script is stopped; the script’s promise is rejected whatever the function does after.
Trait Implementations§
Source§impl Clone for HostCallContext
impl Clone for HostCallContext
Auto Trait Implementations§
impl Forget for HostCallContext
impl Freeze for HostCallContext
impl Move for HostCallContext
impl RefUnwindSafe for HostCallContext
impl Send for HostCallContext
impl Sync for HostCallContext
impl Unpin for HostCallContext
impl UnsafeUnpin for HostCallContext
impl UnwindSafe for HostCallContext
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
Mutably borrows from an owned value. Read more