[][src]Enum dqcsim::common::protocol::SimulatorToPlugin

pub enum SimulatorToPlugin {
    Initialize(Box<PluginInitializeRequest>),
    AcceptUpstream,
    UserInitialize(PluginUserInitializeRequest),
    Abort,
    RunRequest(FrontendRunRequest),
    ArbRequest(ArbCmd),
}

Simulator/host to plugin requests.

Variants

Initialize(Box<PluginInitializeRequest>)

Request to initialize the plugin.

This is always the first message sent by DQCsim. In response, the plugin must:

  • initialize its logging facilities (note that the tee files provided by the copy of the plugin configuration are to be handled by the plugin);
  • verify with the user code that the plugin implementation is of the expected type (frontend, operator, or backend);
  • connect to the downstream plugin if the plugin is not a backend;
  • initialize an IPC endpoint for the upstream plugin to connect to if the plugin is not a frontend;
  • return the aforementioned URI to the simulator through a PluginToSimulator::Initialized message.

The valid responses to this message are:

  • success: PluginToSimulator::Initialized
  • failure: PluginToSimulator::Failure
AcceptUpstream

Request to complete the connection with the upstream plugin.

This is always the second message sent by DQCsim for operators and backends. It is called after the upstream plugin has been successfully initialized. In response, the plugin must wait for the upstream plugin to connect and finish setting up the connection.

The valid responses to this message are:

  • success: PluginToSimulator::Success
  • failure: PluginToSimulator::Failure
UserInitialize(PluginUserInitializeRequest)

Request to run user initialization code.

This is always the second (frontend) or third (operator, backend) message sent by DQCsim.

The valid responses to this message are:

  • success: PluginToSimulator::Success
  • failure: PluginToSimulator::Failure
Abort

Request to abort the simulation and stop the plugin.

The valid responses to this message are:

  • success: PluginToSimulator::Success
  • failure: PluginToSimulator::Failure
RunRequest(FrontendRunRequest)

Passes control from the host to the frontend plugin.

This is only to be sent to frontends. In response, the frontend must:

  • queue up any enclosed messages for reception through the plugin's recv() function;
  • if start is specified, call the user's implementation of the run() callback (if this message was received while already executing run(), return an error instead);
  • if the user's implementation of run() terminates, put its return value in the result field of the response;
  • if the user's implementation of run() queued up messages through send(), put them into the messages field of the response;
  • send the PluginToSimulator::RunResponse message in response.

The valid responses to this message are:

  • success: PluginToSimulator::RunResponse
  • failure: PluginToSimulator::Failure
ArbRequest(ArbCmd)

Requests execution of the given ArbCmd by the plugin.

The valid responses to this message are:

  • success: PluginToSimulator::ArbResponse
  • failure: PluginToSimulator::Failure

Trait Implementations

impl PartialEq<SimulatorToPlugin> for SimulatorToPlugin[src]

impl Into<SimulatorToPlugin> for ArbCmd[src]

impl Into<SimulatorToPlugin> for PluginInitializeRequest[src]

impl Into<SimulatorToPlugin> for PluginAcceptUpstreamRequest[src]

impl Into<SimulatorToPlugin> for PluginUserInitializeRequest[src]

impl Into<SimulatorToPlugin> for FrontendRunRequest[src]

impl Debug for SimulatorToPlugin[src]

impl Serialize for SimulatorToPlugin[src]

impl<'de> Deserialize<'de> for SimulatorToPlugin[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,