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§
- Check
Metadata - The
metadata { … }block of a check — describes the finding it emits. - Execution
Result - 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, orfrom_program, then callrun. - Executor
Config - Runtime configuration for an
Executor: the target base URL plus the network, TLS, and safety knobs. UseExecutorConfig::defaultand 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
CheckMetadataviaFinding::from_metadata. - Http
Request Spec - One HTTP probe, as declared by an
httpblock. - Port
Cache - A TTL cache of
host:portreachability. - Port
Check - Result of probing one
host:port(from cache or live TCP connect). - Program
Spec - 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.
- Socket
Probe Spec - Generic socket options (shared by dns/tcp/udp probes).
Enums§
- Bytecode
Error - Why a
.rbcbyte stream could not be decoded. - Probe
Kind - A probe definition, tagged by transport.
- Runtime
Error - An error that aborts execution. Most variants carry a message; the
#[from]variants wrap lower-level errors (bytecode decode, HTTP, I/O, regex). A failedmatchdoes not produce one of these — onlyassert,fail, and genuine transport/decoding failures do. - Variable
Value - What a script variable can hold.
Functions§
- build_
client - Build the
reqwestclient used for HTTP probes. - bytes_
to_ hex - Lowercase hex encoding of
bytes, with no separators — the inverse ofhex_to_bytes. - bytes_
to_ hex_ dump - A classic 16-byte-per-line hex dump (offset, hex columns, ASCII gutter), used when showing a raw socket response to a human.
- decode_
bytecode - Parse a
.rbcbyte stream back into a program. - encode_
bytecode - Serialize a program to the
.rbcwire format:MAGIC,VERSION, then the metadata, probe table, pools, and instruction stream in the order given in the module docs. - format_
human - Render a program as human-readable disassembly: metadata, the probe table, each constant pool, and the instruction stream with its operands resolved back to the strings and matchers they point at.
- hex_
to_ bytes - Decode a hex string into bytes, ignoring ASCII whitespace so a dump that has been wrapped across lines still decodes.
- load_
bytecode_ input - Decode a hex string into raw bytecode bytes.
- parse_
duration - Parse a duration string with one of the supported suffixes: