Skip to main content

Crate id_effect_proc_macro

Crate id_effect_proc_macro 

Source
Expand description

Procedural macros for the workspace effect crate.

Doc links cannot use the id_effect::… prefix here: this crate defines an effect function, which shadows the effect crate name in rustdoc link resolution.

Macros§

caps
caps!(A, B, C) is the environment type HCons<A, HCons<B, HCons<C, HNil>>>. A capability listed twice (compared by token) is one compile error at the repeat; the de-duplicated list is still emitted so no further errors cascade.
effect
Do-notation over an async body, building an id_effect::Effect.
effect_local
Like effect!, but builds an id_effect::LocalEffect, whose body may hold !Send values. ~expr binds a LocalEffect or a Send Effect over a part of R.
match_effect
Enum match helper — prefix variant patterns with EnumPath for exhaustiveness checking.

Attribute Macros§

distributed_behavior
Mark a process struct as a remotely spawnable behavior.
effect_tagged
Injects pub _tag: &'static str, an [id_effect::match_::HasTag] impl, and EFFECT_TAGGED_TAG on the struct (see generated inherent associated const).

Derive Macros§

EffectData
Derive macro: structural PartialEq, Eq, and Hash for Effect.ts-style data types.
Entity
Derive id_effect_sql::Entity (map a #[derive(FromRow)] struct to a table for Repository<T>; id_effect_sql feature repository).
FromRow
Derive id_effect_sql::FromRow (decode a struct with named fields from an SqlRow).
Fsm
Derive id_effect_fsm::Fsm (initial state + transition table) for a fieldless state enum.
Optics
Derive field lenses and enum prisms for [id_effect_optics].
ProviderSpec
Derive an inherent layer() (an id_effect::Layer providing the service) from #[provides(Service)]. Re-exported by id_effect as ProviderSpecDerive.
Schema
Derive an inherent schema() constructor and an [id_effect::schema::HasSchema] impl for a struct with named fields (JSON-shaped [id_effect::schema::Unknown] wire).