Skip to main content

AgentTerminal

Trait AgentTerminal 

Source
pub trait AgentTerminal: Send + Sync {
    // Required methods
    fn spawn(
        &self,
        spec: &Value,
    ) -> Result<Object<dyn TerminalRun>, ProviderError>;
    fn spawn_private(
        &self,
        spec: &Value,
    ) -> Result<Object<dyn TerminalRun>, ProviderError>;

    // Provided method
    fn into_object(self) -> Object<dyn AgentTerminal>
       where Self: Sized + Send + 'static { ... }
}
Expand description

The object handle AgentHandlers use to ask AI6’s selected terminal provider to spawn.

Required Methods§

Source

fn spawn(&self, spec: &Value) -> Result<Object<dyn TerminalRun>, ProviderError>

Starts a terminal process through AI6’s selected Terminal provider.

Source

fn spawn_private( &self, spec: &Value, ) -> Result<Object<dyn TerminalRun>, ProviderError>

Starts a command the handler runs for itself, through the same provider: its output goes to the handler alone, never to the Run’s viewers, its watchdog or operator input. For a probe, whose output can hold what no viewer may read.

Provided Methods§

Source

fn into_object(self) -> Object<dyn AgentTerminal>
where Self: Sized + Send + 'static,

This implementation as a handle: boxed beside its table, destroyed when the handle is dropped.

Trait Implementations§

Source§

impl From<Remote<dyn AgentTerminal>> for Box<dyn AgentTerminal>

Source§

fn from(remote: Remote<dyn AgentTerminal>) -> Self

Converts to this type from the input type.
Source§

impl Kind for dyn AgentTerminal

Source§

const NAME: &'static str = "ai6_agent_terminal"

The kind’s name in a descriptor’s kinds and tables.
Source§

const FLOOR: usize

The size of [Kind::Vtable]: every slot. A table declaring less is refused; a larger one has slots appended after these.
Source§

const FLOOR_HASH: u32 = AgentTerminalVtable::FLOOR_HASH

FNV-1a over the shape and every method’s name and normalised signature, in table order. A table carrying another number was built from a different declaration of this kind. Read more
Source§

const REQUIRED: &'static [(&'static str, usize)]

Every required slot as (method name, one past its end), so a null one is refused by name.
Source§

const OBJECT: bool = true

Whether this is an object kind (#[guatiao::kind(object)]): a handle one caller owns, with a destroy slot first and &mut self methods, never offered by a registry. See [Object]. Read more
Source§

type Vtable = AgentTerminalVtable

The repr(C) table, which starts with a [KindHeader].
Source§

fn as_dyn(remote: &Remote<Self>) -> &Self

The trait object over a proxy. The macro writes remote, because only it knows the trait.
Source§

fn as_dyn_mut(remote: &mut Remote<Self>) -> &mut Self

The same, mutably — what an [Object] hands out.
Source§

fn boxed(remote: Remote<Self>) -> Box<Self>

The same, boxed.
Source§

fn shared(remote: Remote<Self>) -> Arc<Self> ⓘ

The same, shared.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AgentTerminal for Remote<dyn AgentTerminal>

Source§

fn spawn(&self, spec: &Value) -> Result<Object<dyn TerminalRun>, ProviderError>

Source§

fn spawn_private( &self, spec: &Value, ) -> Result<Object<dyn TerminalRun>, ProviderError>

Implementors§