Skip to main content

GuestAgentFactory

Trait GuestAgentFactory 

Source
pub trait GuestAgentFactory: Send + Sync {
    // Required methods
    fn readiness(&self) -> Readiness;
    fn arm_readiness<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prepared: &'life1 dyn PreparedVm,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ReadyGate>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn connect(
        &self,
        handle: Arc<dyn VmHandle>,
        net: Option<&NetworkIdentity>,
    ) -> Result<Arc<dyn GuestAgent>>;
}
Expand description

Builds the agent client for one Computer, and knows how that Computer’s guest announces it is serving.

Required Methods§

Source

fn readiness(&self) -> Readiness

How a guest built by this factory announces readiness.

Source

fn arm_readiness<'life0, 'life1, 'async_trait>( &'life0 self, prepared: &'life1 dyn PreparedVm, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ReadyGate>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Arm the readiness observer before the guest starts.

Readiness::DialOut has no other option: the guest dials the host the moment it is serving, and a VMM forwards that connect only if someone is already listening — otherwise the guest is reset and the one readiness event is lost. The other shapes bind nothing here and do their work in ReadyGate::wait.

Source

fn connect( &self, handle: Arc<dyn VmHandle>, net: Option<&NetworkIdentity>, ) -> Result<Arc<dyn GuestAgent>>

The agent client for a VM that has booted or restored.

net is what the guest was told over its interface, for an agent reached at that address rather than through the VM handle. None when the Computer is networkless — or when it is networked but no address names it yet, as a legacy-addressed restore is until its re-address RPC lands and it is reconnected with the settled one.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§