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
The modules themselves are private; every type below is re-exported here, so the module column is plain text while the type column links to the public item.
| Module | Types |
|---|---|
error | crate::domain::DomainError, crate::domain::secret_nonempty |
names | crate::domain::VpsName, crate::domain::SshHost, crate::domain::SshUser, crate::domain::HostTag |
ports | crate::domain::SshPort, crate::domain::BindPort |
limits | crate::domain::TimeoutMs, crate::domain::CharLimit |
command | crate::domain::RemoteCommand, crate::domain::KeyPath |
time | crate::domain::Rfc3339Utc, crate::domain::AddedAt, crate::domain::CreatedAt |
ids | crate::domain::CorrelationId (v4), crate::domain::BatchRunId (v7) |
http_url | crate::domain::HttpsUrl, crate::domain::AcmeOrderUrl |
money | crate::domain::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).