Skip to main content

ServiceManifest

Struct ServiceManifest 

Source
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: ServiceMode§authorization: Option<AuthorizationConfig>

Authorization 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: bool

Serve the auto-generated GraphQL endpoint. Off unless the service opts in.

§routing: RoutingMode

How 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: ConsumerNaming

How the durable consumers of the service’s subscriptions are named.

§streams: Vec<StreamDefinition>§schedules: Vec<ScheduleDefinition>§schema: SchemaOwnership

Who 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

Source

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

Source

pub fn get_table(&self, name: &str) -> Option<&TableDefinition>

Get table definition by name

Source

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.

Source

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.

Source

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.

Source

pub fn http_route_index(&self, handler: &str) -> Option<usize>

The position of http_route in custom_routes.

Source

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.

Source

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.

Source

pub fn migration_history(&self) -> MigrationHistory

Where the service’s applied SQL migrations are recorded.

Source

pub fn without_migration_bodies(self) -> Self

The manifest without the text of its SQL migrations, which only a deploy reads.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for ServiceManifest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServiceManifest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServiceManifest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ServiceManifest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ServiceManifest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.