pub struct Ports {Show 17 fields
pub config: Arc<dyn Config>,
pub db: Option<Arc<dyn Database>>,
pub mailer: Option<Arc<dyn Mailer>>,
pub captcha: Option<Arc<dyn Captcha>>,
pub rate_limiter: Option<Arc<dyn RateLimiter>>,
pub signer: Option<Arc<dyn Signer>>,
pub kv: Option<Arc<dyn KeyValue>>,
pub blob: Option<Arc<dyn Blob>>,
pub push: Option<Arc<dyn Push>>,
pub payments: Option<Arc<dyn Payments>>,
pub realtime: Option<Arc<dyn Realtime>>,
pub http: Option<Arc<dyn HttpClient>>,
pub clock: Option<Arc<dyn Clock>>,
pub id_gen: Option<Arc<dyn IdGen>>,
pub defer: Option<Arc<dyn Defer>>,
pub dispatcher: Option<Arc<dyn Dispatcher>>,
pub tenants: Option<Arc<dyn TenantRouting>>,
}Expand description
The per-request bundle of resolved port implementations plus the typed config the runtime built from environment/secrets.
Every port is optional: the Cloudflare runtime resolves what the venture’s
bindings actually provide and leaves the rest None.
Fields§
§config: Arc<dyn Config>§db: Option<Arc<dyn Database>>§mailer: Option<Arc<dyn Mailer>>§captcha: Option<Arc<dyn Captcha>>§rate_limiter: Option<Arc<dyn RateLimiter>>§signer: Option<Arc<dyn Signer>>§kv: Option<Arc<dyn KeyValue>>§blob: Option<Arc<dyn Blob>>§push: Option<Arc<dyn Push>>§payments: Option<Arc<dyn Payments>>§realtime: Option<Arc<dyn Realtime>>§http: Option<Arc<dyn HttpClient>>§clock: Option<Arc<dyn Clock>>§id_gen: Option<Arc<dyn IdGen>>§defer: Option<Arc<dyn Defer>>§dispatcher: Option<Arc<dyn Dispatcher>>Set by the runtime when the venture mounts sidecar modules. Not a
Port, so view_for never copies it and no module can reach it.
tenants: Option<Arc<dyn TenantRouting>>How this deployment turns a host into a tenant, and a tenant into
its database (TENANT-ROUTING.md §3-§5). None is the no registry
deployment — Cloudflare, the browser, and native in development and
test — which resolves every host to the implicit tenant and hands
back Ports::db.
Not a Port for the same reason dispatcher is not: view_for
must never copy it into a module’s view. A module reaches a
database through the TenantConn extractor, which can only give it
the one the request resolved.
Implementations§
Source§impl Ports
impl Ports
Sourcepub fn empty() -> Self
pub fn empty() -> Self
An empty bundle with no ports resolved and an
EmptyConfig.