pub struct ServiceManifest {Show 13 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,
}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.
Implementations§
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,
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 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 deploy_hash(&self) -> String
pub fn deploy_hash(&self) -> 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) -> String
pub fn schema_hash(&self) -> String
SHA-256 of the schema-bearing fields, stored on schema snapshots.