Skip to main content

ServiceManifest

Struct ServiceManifest 

Source
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: 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.

Implementations§

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, 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 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 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.

Source

pub fn schema_hash(&self) -> String

SHA-256 of the schema-bearing fields, stored on schema snapshots.

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<'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.