Expand description
Domain newtypes (parse, don’t validate — G-TYPE / G-DOM 4-crates). Domain newtypes — parse, don’t validate (G-TYPE / G-DOM).
Workload: pure local construction (sequential). Parallelism starts only after
typed values reach SSH fan-out. Zero-cost: wrappers are #[repr(transparent)]
or niche-optimized enums.
Rules: private fields, try_new only, no Deref, no infallible From with
invariants. Wire DTOs stay primitives; domain carries the proof.
§Modules
| Module | Types |
|---|---|
error | [DomainError], [secret_nonempty] |
[names] | [VpsName], [SshHost], [SshUser], [HostTag] |
[ports] | [SshPort], [BindPort] |
[limits] | [TimeoutMs], [CharLimit] |
[command] | [RemoteCommand], [KeyPath] |
[time] | [Rfc3339Utc], [AddedAt], [CreatedAt] |
[ids] | [CorrelationId] (v4), [BatchRunId] (v7) |
[http_url] | [HttpsUrl], [AcmeOrderUrl] |
[money] | [Money] (library-only; no SSH/VPS CLI surface — G-E2E-14) |
Structs§
- Acme
Order Url - ACME order URL (distinct newtype so it cannot be mixed with generic HTTPS URLs).
- Batch
RunId - Time-ordered batch run id (UUID v7) for multi-host JSON envelopes.
- Bind
Port - Local bind port:
0means ephemeral OS assignment; otherwise1..=65535. - Brl
- Brazilian Real.
- Correlation
Id - Random correlation id (UUID v4).
- Domain
Error - Error constructing a domain value (maps to
crate::errors::SshCliError::Domain). - HostTag
- Single host tag (1..=MAX_TAG_LEN, no path separators/controls).
- Https
Url - HTTPS URL with non-empty host (rejects
data:,javascript:, non-https). - KeyPath
- Non-empty private key path.
- Money
- Amount of currency
Cwith exact decimal arithmetic. - Remote
Command - Remote shell command payload (non-empty after trim, no NUL bytes).
- Rfc3339
Utc - Instant stored as UTC, serialized as RFC 3339.
- SshHost
- SSH hostname or IP (non-empty after trim, max
MAX_FIELD_LEN). - SshPort
- SSH TCP port in
1..=65535(zero is unrepresentable). - SshUser
- SSH username (non-empty after trim, max
MAX_FIELD_LEN). - Timeout
Ms - Timeout in milliseconds (
1..=MAX_TIMEOUT_MS). - Usd
- US Dollar.
- VpsName
- Logical VPS registry name (NFC, path-safe, non-empty).
Enums§
- Char
Limit - Character budget:
0on the wire means unlimited.
Traits§
- Currency
- Currency marker (zero-sized). Scale is fixed per currency.
Functions§
- domain_
err - Maps
DomainErrorinto the crate result type viaFrom. - secret_
nonempty - True when a
SecretStringholds a non-empty secret (G-TYPE-12 — single helper). - try_
tags - Parses a tag list with cardinality cap (G-TYPE-05 container).