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§
const NAME: &'static str
const EVIDENCE: EvidenceRequirement
Sourceconst CAPABILITIES: BackendCapabilities
const CAPABILITIES: BackendCapabilities
The actual physical runtime’s facts, not an assurance or test verdict.
Sourceconst LOG_TRANSPORT: VerificationLogTransport
const LOG_TRANSPORT: VerificationLogTransport
Required physical record transport; independent of descriptor sharing.
Provided Associated Constants§
Sourceconst PREPARES_RECORD: bool = false
const PREPARES_RECORD: bool = false
Static record preprocessing support. Core retains the ptrace recorder, canonical program resolver, identity mounts, IO and publication.
Sourceconst SUPPORTS_STRACE: bool = false
const SUPPORTS_STRACE: bool = false
Static syscall-tracing support, checked before host or artifact work.
Sourceconst NATIVE_IDENTITY_DIAGNOSTIC: Option<&'static str> = None
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.
Sourceconst NONDEFAULT_CPU_PROFILE_REFUSAL: &'static str = "only the ptrace backend is qualified"
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§
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>
Sourcefn finish(
&self,
pending: Self::Pending,
observation: Observation<'_>,
) -> Result<Self::Facts, Error>
fn finish( &self, pending: Self::Pending, observation: Observation<'_>, ) -> Result<Self::Facts, Error>
Called only after common latches, log integrity and first-run exit policy.
Sourcefn pair_evidence(
&self,
first: &Self::Facts,
second: &Self::Facts,
) -> Result<PairEvidence, Error>
fn pair_evidence( &self, first: &Self::Facts, second: &Self::Facts, ) -> Result<PairEvidence, Error>
Return complete observations, not matched flags or mutable verdicts.
Provided Methods§
fn option_schemas(&self) -> Vec<OptionSchema>
Sourcefn prepare_record_program(
&self,
_target: &Path,
) -> Result<Option<PathBuf>, Error>
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.
Sourcefn strace(&self, _program: &Path, _args: &[String]) -> Result<ExitStatus, Error>
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.
Sourcefn validate_mode(&self, mode: Mode) -> Result<(), Error>
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.
Sourcefn save_native_evidence(
&self,
_facts: &Self::Facts,
) -> Result<SavedNativeEvidence, Error>
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.
Sourcefn restore_native_evidence(
&self,
_evidence: SavedNativeEvidenceRef<'_>,
) -> Result<Self::Facts, Error>
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".