Skip to main content

Crate ruso_runtime

Crate ruso_runtime 

Source
Expand description

Ruso VM: execute compiled bytecode against HTTP, DNS, TCP, and UDP targets.

Compilers (e.g. ruso-script) must target opcode::VERSION and the instruction set documented in opcode.

§Developer documentation

Re-exports§

pub use contract::BodyValue;
pub use contract::CmpOp;
pub use contract::CmpValue;
pub use contract::EvidenceKind;
pub use contract::ExtractSource;
pub use contract::FieldKind;
pub use contract::HttpMethod;
pub use contract::InlinePart;
pub use contract::InlinePartBody;
pub use contract::MatchPredicate;
pub use contract::ObjectBody;
pub use contract::QualifiedField;
pub use contract::QualifiedMatch;
pub use contract::Severity;
pub use opcode::BytecodeProgram;
pub use opcode::MAGIC;
pub use opcode::Opcode;
pub use opcode::Pc;
pub use opcode::VERSION;
pub use util::truncate_str;

Modules§

contract
Shared types embedded in Ruso bytecode (constant pools and probe specs).
disasm
Human-readable bytecode disassembly.
opcode
Opcode and bytecode wire-format contract (version 1).
util
Shared utility helpers with no domain dependencies.

Structs§

CheckMetadata
The metadata { … } block of a check — describes the finding it emits.
ExecutionResult
The outcome of one Executor::run: whether a finding was produced, plus the report, port-check details, and final variable state.
Executor
Executes a compiled program against a target. Construct one with from_bytes, from_bytecode, or from_program, then call run.
ExecutorConfig
Runtime configuration for an Executor: the target base URL plus the network, TLS, and safety knobs. Use ExecutorConfig::default and override the fields you care about.
Finding
A single positive result: the check’s metadata resolved into a concrete finding, plus the evidence captured during the run. Built from CheckMetadata via Finding::from_metadata.
HttpRequestSpec
PortCache
PortCheck
Result of probing one host:port (from cache or live TCP connect).
ProgramSpec
The non-executable part of a compiled program: the probe table and the finding metadata. The instruction stream lives in BytecodeProgram.
Report
A run’s findings. At most one finding is produced per script execution, so this holds zero or one entry.
SocketProbeSpec
Generic socket options (shared by dns/tcp/udp probes).

Enums§

BytecodeError
ProbeKind
A probe definition, tagged by transport.
RuntimeError
An error that aborts execution. Most variants carry a message; the #[from] variants wrap lower-level errors (bytecode decode, HTTP, I/O, regex). A failed match does not produce one of these — only assert, fail, and genuine transport/decoding failures do.
VariableValue

Functions§

build_client
bytes_to_hex
bytes_to_hex_dump
decode_bytecode
encode_bytecode
format_human
hex_to_bytes
load_bytecode_input
Decode a hex string into raw bytecode bytes.
parse_duration
Parse a duration string with one of the supported suffixes: