Skip to content
Open
1 change: 0 additions & 1 deletion test/src/alarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ impl DurableObject for AlarmObject {
}
}

#[worker::send]
pub async fn handle_alarm(_req: Request, env: Env, _data: SomeSharedData) -> Result<Response> {
let namespace = env.durable_object("ALARM")?;
let stub = namespace.id_from_name("alarm")?.get_stub()?;
Expand Down
3 changes: 1 addition & 2 deletions test/src/analytics_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::SomeSharedData;
use uuid::Uuid;
use worker::{AnalyticsEngineDataPointBuilder, Env, Request, Response, Result};

#[worker::send]
pub async fn handle_analytics_event(
req: Request,
env: Env,
Expand Down Expand Up @@ -31,5 +30,5 @@ pub async fn handle_analytics_event(
.add_double(200)
.write_to(&dataset)?;

return Response::ok("Events sent");
Response::ok("Events sent")
}
1 change: 0 additions & 1 deletion test/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub async fn handle_asset(
}

#[cfg(feature = "http")]
#[worker::send]
pub async fn handle_asset(
req: worker::Request,
env: worker::Env,
Expand Down
1 change: 0 additions & 1 deletion test/src/auto_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ impl DurableObject for AutoResponseObject {
}

// Route handler to exercise the Durable Object from tests.
#[worker::send]
pub async fn handle_auto_response(
_req: Request,
env: Env,
Expand Down
5 changes: 0 additions & 5 deletions test/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ fn key(req: &Request) -> Result<Option<String>> {
Ok(segments.nth(2).map(ToOwned::to_owned))
}

#[worker::send]
pub async fn handle_cache_example(
req: Request,
_env: Env,
Expand All @@ -34,7 +33,6 @@ pub async fn handle_cache_example(
}
}

#[worker::send]
pub async fn handle_cache_api_get(
req: Request,
_env: Env,
Expand All @@ -50,7 +48,6 @@ pub async fn handle_cache_api_get(
Response::error("key missing", 400)
}

#[worker::send]
pub async fn handle_cache_api_put(
req: Request,
_env: Env,
Expand All @@ -69,7 +66,6 @@ pub async fn handle_cache_api_put(
Response::error("key missing", 400)
}

#[worker::send]
pub async fn handle_cache_api_delete(
req: Request,
_env: Env,
Expand All @@ -84,7 +80,6 @@ pub async fn handle_cache_api_delete(
Response::error("key missing", 400)
}

#[worker::send]
pub async fn handle_cache_stream(
req: Request,
_env: Env,
Expand Down
2 changes: 0 additions & 2 deletions test/src/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ impl DurableObject for Counter {
}
}

#[worker::send]
pub async fn handle_id(req: Request, env: Env, _data: SomeSharedData) -> Result<Response> {
let durable_object_name = if req.path().contains("shared") {
"SHARED_COUNTER"
Expand All @@ -106,7 +105,6 @@ pub async fn handle_id(req: Request, env: Env, _data: SomeSharedData) -> Result<
stub.fetch_with_str("https://fake-host/").await
}

#[worker::send]
pub async fn handle_websocket(req: Request, env: Env, _data: SomeSharedData) -> Result<Response> {
let durable_object_name = if req.path().contains("shared") {
"SHARED_COUNTER"
Expand Down
14 changes: 0 additions & 14 deletions test/src/d1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct Person {
age: u32,
}

#[worker::send]
pub async fn prepared_statement(
_req: Request,
env: Env,
Expand Down Expand Up @@ -68,7 +67,6 @@ pub async fn prepared_statement(
Response::ok("ok")
}

#[worker::send]
pub async fn batch(_req: Request, env: Env, _data: SomeSharedData) -> Result<Response> {
let db = env.d1("DB")?;
let mut results = db
Expand All @@ -93,7 +91,6 @@ pub async fn batch(_req: Request, env: Env, _data: SomeSharedData) -> Result<Res
Response::ok("ok")
}

#[worker::send]
pub async fn exec(mut req: Request, env: Env, _data: SomeSharedData) -> Result<Response> {
let db = env.d1("DB")?;
let result = db
Expand All @@ -104,14 +101,12 @@ pub async fn exec(mut req: Request, env: Env, _data: SomeSharedData) -> Result<R
Response::ok(result.count()?.unwrap_or_default().to_string())
}

#[worker::send]
pub async fn dump(_req: Request, env: Env, _data: SomeSharedData) -> Result<Response> {
let db = env.d1("DB")?;
let bytes = db.dump().await?;
Response::from_bytes(bytes)
}

#[worker::send]
pub async fn error(_req: Request, env: Env, _data: SomeSharedData) -> Result<Response> {
let db = env.d1("DB")?;
let error = db
Expand All @@ -138,7 +133,6 @@ struct NullablePerson {
age: Option<u32>,
}

#[worker::send]
pub async fn jsvalue_null_is_null(
_req: Request,
_env: Env,
Expand All @@ -149,7 +143,6 @@ pub async fn jsvalue_null_is_null(
Response::ok("ok")
}

#[worker::send]
pub async fn serialize_optional_none(
_req: Request,
_env: Env,
Expand All @@ -164,7 +157,6 @@ pub async fn serialize_optional_none(
Response::ok("ok")
}

#[worker::send]
pub async fn serialize_optional_some(
_req: Request,
_env: Env,
Expand All @@ -179,7 +171,6 @@ pub async fn serialize_optional_some(
Response::ok("ok")
}

#[worker::send]
pub async fn deserialize_optional_none(
_req: Request,
_env: Env,
Expand All @@ -201,7 +192,6 @@ pub async fn deserialize_optional_none(
Response::ok("ok")
}

#[worker::send]
pub async fn insert_and_retrieve_optional_none(
_req: Request,
env: Env,
Expand All @@ -227,7 +217,6 @@ pub async fn insert_and_retrieve_optional_none(
Response::ok("ok")
}

#[worker::send]
pub async fn insert_and_retrieve_optional_some(
_req: Request,
env: Env,
Expand All @@ -252,7 +241,6 @@ pub async fn insert_and_retrieve_optional_some(
Response::ok("ok")
}

#[worker::send]
pub async fn retrieve_optional_none(
_req: Request,
env: Env,
Expand All @@ -269,7 +257,6 @@ pub async fn retrieve_optional_none(
Response::ok("ok")
}

#[worker::send]
pub async fn retrieve_optional_some(
_req: Request,
env: Env,
Expand All @@ -286,7 +273,6 @@ pub async fn retrieve_optional_some(
Response::ok("ok")
}

#[worker::send]
pub async fn retrive_first_none(
_req: Request,
env: Env,
Expand Down
6 changes: 0 additions & 6 deletions test/src/durable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ impl DurableObject for MyClass {
}

// Route handlers to exercise the Durable Object from tests.
#[worker::send]
pub async fn handle_hello(
_req: Request,
env: Env,
Expand All @@ -178,7 +177,6 @@ pub async fn handle_hello(
.await
}

#[worker::send]
pub async fn handle_hello_unique(
_req: Request,
env: Env,
Expand All @@ -192,7 +190,6 @@ pub async fn handle_hello_unique(
.await
}

#[worker::send]
pub async fn handle_storage(
_req: Request,
env: Env,
Expand All @@ -203,7 +200,6 @@ pub async fn handle_storage(
stub.fetch_with_str("https://fake-host/storage").await
}

#[worker::send]
pub async fn handle_basic_test(
_req: Request,
env: Env,
Expand Down Expand Up @@ -278,7 +274,6 @@ pub async fn handle_basic_test(
Response::ok("ok")
}

#[worker::send]
pub async fn handle_get_by_name(
_req: Request,
env: Env,
Expand All @@ -296,7 +291,6 @@ pub async fn handle_get_by_name(
.await
}

#[worker::send]
pub async fn handle_get_by_name_with_location_hint(
_req: Request,
env: Env,
Expand Down
9 changes: 0 additions & 9 deletions test/src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use worker::{
RequestInit, Response, Result,
};

#[worker::send]
pub async fn handle_fetch(_req: Request, _env: Env, _data: SomeSharedData) -> Result<Response> {
let req = Request::new("https://example.com", Method::Post)?;
let resp = Fetch::Request(req).send().await?;
Expand All @@ -19,7 +18,6 @@ pub async fn handle_fetch(_req: Request, _env: Env, _data: SomeSharedData) -> Re
))
}

#[worker::send]
pub async fn handle_fetch_json(
_req: Request,
_env: Env,
Expand All @@ -40,7 +38,6 @@ pub async fn handle_fetch_json(
))
}

#[worker::send]
pub async fn handle_proxy_request(
req: Request,
_env: Env,
Expand All @@ -57,7 +54,6 @@ pub async fn handle_proxy_request(
Fetch::Url(url.parse()?).send().await
}

#[worker::send]
pub async fn handle_request_init_fetch(
_req: Request,
_env: Env,
Expand All @@ -69,7 +65,6 @@ pub async fn handle_request_init_fetch(
.await
}

#[worker::send]
pub async fn handle_request_init_fetch_post(
_req: Request,
_env: Env,
Expand All @@ -82,7 +77,6 @@ pub async fn handle_request_init_fetch_post(
.await
}

#[worker::send]
pub async fn handle_cancelled_fetch(
_req: Request,
_env: Env,
Expand Down Expand Up @@ -115,7 +109,6 @@ pub async fn handle_cancelled_fetch(
Ok(res)
}

#[worker::send]
pub async fn handle_fetch_timeout(
_req: Request,
_env: Env,
Expand Down Expand Up @@ -158,7 +151,6 @@ pub async fn handle_fetch_timeout(
}
}

#[worker::send]
pub async fn handle_cloned_fetch(
_req: Request,
_env: Env,
Expand All @@ -179,7 +171,6 @@ pub async fn handle_cloned_fetch(
Response::ok((left == right).to_string())
}

#[worker::send]
pub async fn handle_cloned_response_attributes(
_req: Request,
_env: Env,
Expand Down
4 changes: 0 additions & 4 deletions test/src/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use serde::{Deserialize, Serialize};
use std::convert::TryFrom;
use worker::{kv, Env, FormEntry, Request, Response, Result};

#[worker::send]
pub async fn handle_formdata_name(
mut req: Request,
_env: Env,
Expand Down Expand Up @@ -48,7 +47,6 @@ struct FileSize {
size: u32,
}

#[worker::send]
pub async fn handle_formdata_file_size(
mut req: Request,
env: Env,
Expand Down Expand Up @@ -88,7 +86,6 @@ pub async fn handle_formdata_file_size(
Response::error("Bad Request", 400)
}

#[worker::send]
pub async fn handle_formdata_file_size_hash(
req: Request,
env: Env,
Expand All @@ -108,7 +105,6 @@ pub async fn handle_formdata_file_size_hash(
Response::error("Bad Request", 400)
}

#[worker::send]
pub async fn handle_is_secret(
mut req: Request,
env: Env,
Expand Down
2 changes: 0 additions & 2 deletions test/src/js_snippets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ extern "C" {
fn js_console_log(value: String);
}

#[worker::send]
pub async fn performance_now(_req: Request, _env: Env, _data: SomeSharedData) -> Result<Response> {
Response::ok(format!("now: {}", js_performance_now()))
}

#[worker::send]
pub async fn console_log(_req: Request, _env: Env, _data: SomeSharedData) -> Result<Response> {
js_console_log("test".to_owned());
Response::ok("OK")
Expand Down
Loading