You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use worker::{durable_object,Env,Request,Response};#[durable_object]pubstructOne{counter:u32,}#[durable_object]implDurableObjectforOne{fnnew(state:State,env:Env) -> Self{Self{counter:0,}}asyncfnfetch(&mutself,req:Request) -> worker::Result<Response>{Response::ok("one")}}#[durable_object]pubstructTwo{counter:u32,}#[durable_object]implDurableObjectforTwo{fnnew(state:State,env:Env) -> Self{Self{counter:0,}}asyncfnfetch(&mutself,req:Request) -> worker::Result<Response>{Response::ok("one")}}
wrangler dev or wrangler deploy always results in a rust compiler error, because the macro apparently emits the same symbols each time it's invoked.
error[E0428]: the name `__Need_Durable_Object_Trait_Impl_With_durable_object_Attribute` is defined multiple times
--> src/durable.rs:90:1
|
72 | #[durable_object]
| ----------------- previous definition of the trait `__Need_Durable_Object_Trait_Impl_With_durable_object_Attribute` here
...
90 | #[durable_object]
| ^^^^^^^^^^^^^^^^^ `__Need_Durable_Object_Trait_Impl_With_durable_object_Attribute` redefined here
|
= note: `__Need_Durable_Object_Trait_Impl_With_durable_object_Attribute` must be defined only once in the type namespace of this module
= note: this error originates in the attribute macro `durable_object` (in Nightly builds, run with -Z macro-backtrace for more info)
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
What version of
workers-rs
are you using?0.0.18
What version of
wrangler
are you using?3.22.3
Describe the bug
Attempting to declare multiple
#[durable_object]
structs in the same module always results in a compile error.Furthermore, there is no documentation on the macro so it's not clear how it is supposed to be used.
Steps To Reproduce
Example code:
wrangler dev
orwrangler deploy
always results in a rust compiler error, because the macro apparently emits the same symbols each time it's invoked.The text was updated successfully, but these errors were encountered: