Skip to main content

Module output

Module output 

Source
Expand description

Only module allowed to emit stdout for VPS CRUD.

Centralizes all CRUD formatting for text and JSON emission.

Logs (tracing) go to stderr, managed by tracing-subscriber.

§JSON wire

Agent JSON is compact single-root RFC 8259 (see crate::json_wire). Pretty-print is intentionally not used on the machine path.

Functions§

emit_success
Agent-first success emitter (GAP-AUD-003/008).
emit_success_fmt
Like emit_success, but the human line is built with format_args! (G-MAC-01).
export_envelope_json
Full vps export --json envelope (typed).
export_hosts_to_json
GAP-SSH-UX-001: hosts for vps export --json.
is_quiet
Returns whether quiet mode is active.
print_details_json
Prints a single VPS record as masked text.
print_details_text
Prints the VPS list as masked JSON.
print_doctor_text
Prints the doctor report as human text (GAP-SSH-IO-005).
print_error
Prints an error message on stderr (human-facing).
print_error_envelope
Emits a JSON error envelope on stderr (GAP-SSH-IO-003 / G-RETRY / G-ERR-08).
print_error_fmt
Stderr error via format_args! — no intermediate String (G-MAC-01).
print_exec_batch
Prints multi-host exec results (text or single-root JSON batch).
print_execution_output
Prints a single VPS record as masked JSON.
print_execution_output_json
Prints stdout/stderr from an SSH command execution.
print_health_batch
Prints multi-host health-check results (text or single-root JSON batch).
print_health_check
Prints SSH command execution output as JSON.
print_health_check_json
Prints a health-check result as JSON.
print_human_banner
Human banner (tunnel etc.): Text+TTY+!quiet+!JSON errors only (GAP-SSH-IO-006).
print_json_value
Prints compact JSON on stdout (agent wire; always respects quiet=false).
print_list_json
Prints VPS list as compact JSON array on stdout.
print_list_text
Prints the VPS list as masked text.
print_scp_batch
Prints multi-host SCP batch results.
print_sftp_batch
Prints multi-host SFTP batch results.
print_sftp_fs_op_json
Prints sftp fs-op JSON (mkdir/rmdir/rm/rename).
print_sftp_list_json
Prints sftp ls JSON.
print_sftp_stat_json
Prints sftp stat JSON.
print_sftp_transfer_json
Prints an SFTP transfer result as JSON (G-SFTP-09).
print_success
Prints a human success message (suppressed with --quiet).
print_success_fmt
Human success via format_args! — no intermediate String (G-MAC-01).
print_transfer_json
Prints an SCP transfer result as JSON (GAP-SSH-IO-007 / SCP-021 / IO-009).
print_tunnel_listening_json
JSON event when the local tunnel listener comes up (GAP-SSH-IO-008).
print_warning
Prints a warning on stderr (agent-visible, never stdout).
print_warning_fmt
Warning with dynamic body via format_args! (G-MAC-01 residual close).
record_to_masked_json
Builds a masked VPS JSON DTO (GAP-SSH-JSON-001).
set_json_errors
Sets whether errors are emitted as a JSON envelope on stderr.
set_quiet
Sets whether the CLI is in quiet mode (GAP-SSH-IO-004).
wants_json_errors
Returns whether errors should use a JSON envelope.
write_line
Writes a line to stdout with pure LF (never CRLF), then flushes.
write_line_fmt
Writes a formatted line to stdout without an intermediate String (G-MAC-01).
write_line_to
Writes a line to an arbitrary Write with pure LF, then flushes (G-IO-11).
write_line_to_fmt
Writes formatted content + pure LF via Write::write_fmt (G-MAC-01).
write_lines
Writes many short lines under a single stdout lock (list/doctor/text dumps).
write_stderr_fmt
Writes a formatted line to stderr without an intermediate String (G-MAC-01).
write_stderr_line
Writes a line to stderr with flush (warnings / human errors).
write_stderr_line_to
Writes a diagnostic line to an arbitrary Write (G-IO-11 DI primitive).
write_stderr_line_to_fmt
Formatted stderr line via write_fmt (G-MAC-01); BrokenPipe → Ok.