# Otoroshi Types for writing Wasm plugin using Rust ```rust mod main; use extism_pdk::*; use otoroshi_rust_types::*; #[plugin_fn] pub fn execute(Json(_context): Json) -> FnResult> { let out = WasmAccessValidatorResponse { result: false, error: Some(WasmAccessValidatorError { message: "you're not authorized".to_owned(), status: 401 }) }; Ok(Json(out)) } /* // WasmRouteMatcher #[plugin_fn] pub fn matches_route(Json(_context): Json) -> FnResult> { /// } // ------------------------- // WasmPreRoute #[plugin_fn] pub fn pre_route(Json(_context): Json) -> FnResult> { /// } // ------------------------- // WasmAccessValidator #[plugin_fn] pub fn can_access(Json(_context): Json) -> FnResult> { /// } // ------------------------- // WasmRequestTransformer #[plugin_fn] pub fn transform_request(Json(_context): Json) -> FnResult> { /// } // ------------------------- // WasmBackend #[plugin_fn] pub fn call_backend(Json(_context): Json) -> FnResult> { /// } // ------------------------- // WasmResponseTransformer #[plugin_fn] pub fn transform_response(Json(_context): Json) -> FnResult> { /// } // ------------------------- // WasmSink #[plugin_fn] pub fn sink_matches(Json(_context): Json) -> FnResult> { /// } #[plugin_fn] pub fn sink_handle(Json(_context): Json) -> FnResult> { /// } // ------------------------- // WasmRequestHandler #[plugin_fn] pub fn handle_request(Json(_context): Json) -> FnResult> { /// } // ------------------------- // WasmJob #[plugin_fn] pub fn job_run(Json(_context): Json) -> FnResult> { /// } */ ```