Skip to main content

BackendAdapter

Trait BackendAdapter 

Source
pub trait BackendAdapter {
    type Options;
    type Session;
    type Pending;
    type Facts;

    const NAME: &'static str;
    const EVIDENCE: EvidenceRequirement;
    const CAPABILITIES: BackendCapabilities;
    const LOG_TRANSPORT: VerificationLogTransport;
    const PREPARES_RECORD: bool = false;
    const SUPPORTS_STRACE: bool = false;
    const NATIVE_IDENTITY_DIAGNOSTIC: Option<&'static str> = None;
    const NONDEFAULT_CPU_PROFILE_REFUSAL: &'static str = "only the ptrace backend is qualified";

    // Required methods
    fn parse(&self, matches: &ArgMatches) -> Result<Self::Options, Error>;
    fn prepare(
        &self,
        options: Self::Options,
        request: Prepare<'_>,
    ) -> Result<Self::Session, Error>;
    fn execute(
        &self,
        session: &mut Self::Session,
        request: Execute<'_>,
    ) -> Result<Execution<Self::Pending>, Error>;
    fn finish(
        &self,
        pending: Self::Pending,
        observation: Observation<'_>,
    ) -> Result<Self::Facts, Error>;
    fn pair_evidence(
        &self,
        first: &Self::Facts,
        second: &Self::Facts,
    ) -> Result<PairEvidence, Error>;

    // Provided methods
    fn option_schemas(&self) -> Vec<OptionSchema> { ... }
    fn prepare_record_program(
        &self,
        _target: &Path,
    ) -> Result<Option<PathBuf>, Error> { ... }
    fn strace(
        &self,
        _program: &Path,
        _args: &[String],
    ) -> Result<ExitStatus, Error> { ... }
    fn validate_mode(&self, mode: Mode) -> Result<(), Error> { ... }
    fn save_native_evidence(
        &self,
        _facts: &Self::Facts,
    ) -> Result<SavedNativeEvidence, Error> { ... }
    fn restore_native_evidence(
        &self,
        _evidence: SavedNativeEvidenceRef<'_>,
    ) -> Result<Self::Facts, Error> { ... }
}
Expand description

One statically linked physical adapter, never a registry or a verdict owner.

The selected executable supplies its own concrete options and state. None of these public types depends on a third-party backend enum or feature.

Required Associated Constants§

Source

const NAME: &'static str

Source

const EVIDENCE: EvidenceRequirement

Source

const CAPABILITIES: BackendCapabilities

The actual physical runtime’s facts, not an assurance or test verdict.

Source

const LOG_TRANSPORT: VerificationLogTransport

Required physical record transport; independent of descriptor sharing.

Provided Associated Constants§

Source

const PREPARES_RECORD: bool = false

Static record preprocessing support. Core retains the ptrace recorder, canonical program resolver, identity mounts, IO and publication.

Source

const SUPPORTS_STRACE: bool = false

Static syscall-tracing support, checked before host or artifact work.

Source

const NATIVE_IDENTITY_DIAGNOSTIC: Option<&'static str> = None

An immutable identity diagnostic, emitted only after both native decoders and their complete pair evidence succeeded. It cannot affect a verdict. Common comparison publishes JSON and every native comparison message before this diagnostic, including when the completed runs diverged.

Source

const NONDEFAULT_CPU_PROFILE_REFUSAL: &'static str = "only the ptrace backend is qualified"

Reason text for the core’s mandatory early refusal of a nondefault CPU profile. An adapter cannot admit a profile through this declaration.

Required Associated Types§

Required Methods§

Source

fn parse(&self, matches: &ArgMatches) -> Result<Self::Options, Error>

Source

fn prepare( &self, options: Self::Options, request: Prepare<'_>, ) -> Result<Self::Session, Error>

Source

fn execute( &self, session: &mut Self::Session, request: Execute<'_>, ) -> Result<Execution<Self::Pending>, Error>

Source

fn finish( &self, pending: Self::Pending, observation: Observation<'_>, ) -> Result<Self::Facts, Error>

Called only after common latches, log integrity and first-run exit policy.

Source

fn pair_evidence( &self, first: &Self::Facts, second: &Self::Facts, ) -> Result<PairEvidence, Error>

Return complete observations, not matched flags or mutable verdicts.

Provided Methods§

Source

fn option_schemas(&self) -> Vec<OptionSchema>

Source

fn prepare_record_program( &self, _target: &Path, ) -> Result<Option<PathBuf>, Error>

Prepare only the supplied core-resolved original program. Return the rewritten file, or None when no overlay is required; this callback cannot select mounts or run a second recorder. Called at each actual recording-container preparation, after common admission.

Source

fn strace(&self, _program: &Path, _args: &[String]) -> Result<ExitStatus, Error>

Run only this executable’s admitted physical tracer. Common logging admission has already completed; this hook cannot select a verdict.

Source

fn validate_mode(&self, mode: Mode) -> Result<(), Error>

Static operation support, checked before input/resource/writer work. This must not probe a runtime or create resources. Saved execution is opt-in only after the adapter uses the real core capture and, for native evidence, implements the raw save/restore owner callbacks below.

Source

fn save_native_evidence( &self, _facts: &Self::Facts, ) -> Result<SavedNativeEvidence, Error>

Preserve the backend’s validated raw native records for the core-owned saved-run writer. This is not a serialization of comparison summaries.

Source

fn restore_native_evidence( &self, _evidence: SavedNativeEvidenceRef<'_>, ) -> Result<Self::Facts, Error>

Restore through the same native decoder and refusal policy as a live run. The core still compares the complete pair_evidence dimensions.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§