pub struct ServiceManifest {Show 24 fields
pub name: String,
pub version: Option<String>,
pub tables: Vec<TableDefinition>,
pub cells: Vec<CellDefinition>,
pub events: Vec<EventDefinition>,
pub subscriptions: Vec<SubscriptionDefinition>,
pub custom_routes: Vec<CustomRouteDefinition>,
pub mode: ServiceMode,
pub authorization: Option<AuthorizationConfig>,
pub on_migrate: Option<String>,
pub publishes: Option<Vec<String>>,
pub required_platform_features: Vec<String>,
pub graphql: bool,
pub routing: RoutingMode,
pub errors: Option<ErrorProfile>,
pub openapi: Option<OpenApiOptions>,
pub components: BTreeMap<String, Value>,
pub consumers: ConsumerNaming,
pub streams: Vec<StreamDefinition>,
pub schedules: Vec<ScheduleDefinition>,
pub schema: SchemaOwnership,
pub schema_name: Option<String>,
pub migrations: Vec<SqlMigration>,
pub migration_history: Option<MigrationHistory>,
}Expand description
A service manifest describes the complete definition of a cufflink service. This is generated by the SDK macros from the user’s Rust struct definitions.
Fields§
§name: String§version: Option<String>§tables: Vec<TableDefinition>§cells: Vec<CellDefinition>§events: Vec<EventDefinition>§subscriptions: Vec<SubscriptionDefinition>§custom_routes: Vec<CustomRouteDefinition>§mode: ServiceModeAuthorization configuration (permission areas and default roles).
on_migrate: Option<String>Optional WASM handler invoked between additive and destructive schema phases of a deploy. Used to backfill or restructure data when columns are split, renamed, or have their semantics changed. The handler must be idempotent — it may be re-invoked on retried deploys.
publishes: Option<Vec<String>>NATS subject patterns (with */> wildcards) this service is allowed to
publish or request outside its own dw.{tenant}.* namespace. None marks
a manifest built before publish authorization existed: the platform then
runs in legacy mode (allow + warn). Some — always emitted by the current
SDK — enables enforcement.
required_platform_features: Vec<String>Platform capabilities this service requires to run safely. The platform
rejects a deploy whose required features it does not advertise at
/api/version. The SDK auto-derives this (e.g. route_posture when any
route declares a posture) so a security-relevant manifest cannot be
silently deployed to a platform too old to enforce it.
graphql: boolServe the auto-generated GraphQL endpoint. Off unless the service opts in.
routing: RoutingModeHow custom routes are reached: legacy serves each only by handler
name under _fn/; strict also matches their declared paths.
errors: Option<ErrorProfile>The JSON key the platform’s own error responses for this service
carry their message under, instead of error.
openapi: Option<OpenApiOptions>The service’s OpenAPI document settings; its presence (or any documented route) makes the spec server-relative.
components: BTreeMap<String, Value>Shared JSON Schemas the route docs refer to as
#/components/schemas/{name}.
consumers: ConsumerNamingHow the durable consumers of the service’s subscriptions are named.
streams: Vec<StreamDefinition>§schedules: Vec<ScheduleDefinition>§schema: SchemaOwnershipWho owns the DDL of the service’s schema.
schema_name: Option<String>The service’s Postgres schema; derived from its name when unset.
migrations: Vec<SqlMigration>The service’s SQL migrations, in version order.
migration_history: Option<MigrationHistory>Implementations§
Source§impl ServiceManifest
impl ServiceManifest
Sourcepub fn derived_features(&self) -> BTreeSet<&'static str>
pub fn derived_features(&self) -> BTreeSet<&'static str>
Features this manifest’s declared shape requires, sorted and deduplicated. A manifest that needs a capability always demands it, so a platform too old to provide it rejects the deploy instead of silently running the service without it.
Source§impl ServiceManifest
impl ServiceManifest
Sourcepub fn get_table(&self, name: &str) -> Option<&TableDefinition>
pub fn get_table(&self, name: &str) -> Option<&TableDefinition>
Get table definition by name
Sourcepub fn requires_wasm(&self) -> bool
pub fn requires_wasm(&self) -> bool
Whether this manifest needs a WASM artifact bundled at deploy time.
A WASM module is required when the service runs user code: explicit
mode: wasm, an on_migrate schema hook, table CRUD lifecycle hooks,
a schedule, or any Wasm subscription/custom-route handler. The CLI uses this to
decide whether to compile a WASM artifact; the platform uses it to
reject deploys that arrive without one.
Sourcepub fn declared_wasm_handlers(&self) -> Vec<&str>
pub fn declared_wasm_handlers(&self) -> Vec<&str>
All handler names this manifest expects the WASM module to export. Used at deploy time to reject manifests whose declared handlers are missing from the bundled binary.
Sourcepub fn http_route(&self, handler: &str) -> Option<&CustomRouteDefinition>
pub fn http_route(&self, handler: &str) -> Option<&CustomRouteDefinition>
The custom_routes entry exposing handler over the HTTP _fn/
surface, if any. Only custom routes are HTTP-invocable; subscription,
on_migrate, and table-hook handlers run solely via their internal
triggers, so a handler absent here must not be dispatched from an
inbound request. Matched by name alone — the _fn/ route accepts every
method, so a verb-aware match would demote a job handler to inline
execution on the wrong verb.
Sourcepub fn http_route_index(&self, handler: &str) -> Option<usize>
pub fn http_route_index(&self, handler: &str) -> Option<usize>
The position of http_route in custom_routes.
Sourcepub fn is_posture_aware(&self) -> bool
pub fn is_posture_aware(&self) -> bool
Whether this manifest was built by a posture-aware SDK. True when any custom route carries a posture — the current SDK emits a posture on every route, so a posture-aware manifest is all-or-nothing and a lone undeclared route among declared ones signals tampering or a bug.
Sourcepub fn schema(&self) -> String
pub fn schema(&self) -> String
The service’s Postgres schema: schema_name, or the service name
with - as _. Every other derivation of it is a bug.
Sourcepub fn migration_history(&self) -> MigrationHistory
pub fn migration_history(&self) -> MigrationHistory
Where the service’s applied SQL migrations are recorded.
Sourcepub fn without_migration_bodies(self) -> Self
pub fn without_migration_bodies(self) -> Self
The manifest without the text of its SQL migrations, which only a deploy reads.
Sourcepub fn deploy_hash(&self) -> Result<String>
pub fn deploy_hash(&self) -> Result<String>
SHA-256 of the whole manifest: the deploy skip check compares this, so
a change to any field (publishes, events, mode, …) deploys.
Sourcepub fn schema_hash(&self) -> Result<String>
pub fn schema_hash(&self) -> Result<String>
SHA-256 of the schema-bearing fields, stored on schema snapshots. A field added since contributes only when it is set, so the hash of a manifest without it never changes.