diff --git a/README.md b/README.md index 2090aab..3d9a5d2 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,43 @@ -# Rust CDEvents SDK - -Rust SDK to emit [CDEvents](https://cdevents.dev). - -The SDK can be used to create CDEvents and send them as CloudEvents, as well as parse a received CloudEvent into a CDEvent. - -## Get started - -```rust -WIP -``` - -## Create your first CDEvent - -To create a CDEvent, for instance a [*pipelineRun queued*](https://cdevents.dev/docs/core/#pipelinerun-queued) one: - -```rust -WIP -``` - -## Send your first CDEvent as CloudEvent - -Import the modules in your code - -```rust -WIP -``` - -To send a CDEvent as CloudEvent: - -```rust -WIP -``` - -See the [CloudEvents](https://github.com/cloudevents/sdk-go#send-your-first-cloudevent) docs as well. - -## Contributing - -If you would like to contribute, see our [development](DEVELOPMENT.md) guide. - -## References - -- [CDEvents](https://cdevents.dev) \ No newline at end of file +# Rust CDEvents SDK + +Rust SDK to emit [CDEvents](https://cdevents.dev). + +The SDK can be used to create CDEvents and send them as CloudEvents, as well as parse a received CloudEvent into a CDEvent. + +## Get started + +```rust +WIP +``` + +## Create your first CDEvent + +To create a CDEvent, for instance a [*pipelineRun queued*](https://cdevents.dev/docs/core/#pipelinerun-queued) one: + +```rust +WIP +``` + +## Send your first CDEvent as CloudEvent + +Import the modules in your code + +```rust +WIP +``` + +To send a CDEvent as CloudEvent: + +```rust +WIP +``` + +See the [CloudEvents](https://github.com/cloudevents/sdk-go#send-your-first-cloudevent) docs as well. + +## Contributing + +If you would like to contribute, see our [development](DEVELOPMENT.md) guide. + +## References + +- [CDEvents](https://cdevents.dev) diff --git a/cdevents-sdk/src/generated/artifact_packaged.rs b/cdevents-sdk/src/generated/artifact_packaged.rs index 859a013..46d7918 100644 --- a/cdevents-sdk/src/generated/artifact_packaged.rs +++ b/cdevents-sdk/src/generated/artifact_packaged.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/artifact_published.rs b/cdevents-sdk/src/generated/artifact_published.rs index e922b9a..4d0f724 100644 --- a/cdevents-sdk/src/generated/artifact_published.rs +++ b/cdevents-sdk/src/generated/artifact_published.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/artifact_signed.rs b/cdevents-sdk/src/generated/artifact_signed.rs index ff40f63..18bbaf8 100644 --- a/cdevents-sdk/src/generated/artifact_signed.rs +++ b/cdevents-sdk/src/generated/artifact_signed.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/branch_created.rs b/cdevents-sdk/src/generated/branch_created.rs index a6f4c7e..afa2999 100644 --- a/cdevents-sdk/src/generated/branch_created.rs +++ b/cdevents-sdk/src/generated/branch_created.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/branch_deleted.rs b/cdevents-sdk/src/generated/branch_deleted.rs index a6f4c7e..afa2999 100644 --- a/cdevents-sdk/src/generated/branch_deleted.rs +++ b/cdevents-sdk/src/generated/branch_deleted.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/build_finished.rs b/cdevents-sdk/src/generated/build_finished.rs index 87618d7..a0b451f 100644 --- a/cdevents-sdk/src/generated/build_finished.rs +++ b/cdevents-sdk/src/generated/build_finished.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/build_queued.rs b/cdevents-sdk/src/generated/build_queued.rs index e922b9a..4d0f724 100644 --- a/cdevents-sdk/src/generated/build_queued.rs +++ b/cdevents-sdk/src/generated/build_queued.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/build_started.rs b/cdevents-sdk/src/generated/build_started.rs index e922b9a..4d0f724 100644 --- a/cdevents-sdk/src/generated/build_started.rs +++ b/cdevents-sdk/src/generated/build_started.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/change_abandoned.rs b/cdevents-sdk/src/generated/change_abandoned.rs index a6f4c7e..afa2999 100644 --- a/cdevents-sdk/src/generated/change_abandoned.rs +++ b/cdevents-sdk/src/generated/change_abandoned.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/change_created.rs b/cdevents-sdk/src/generated/change_created.rs index a6f4c7e..afa2999 100644 --- a/cdevents-sdk/src/generated/change_created.rs +++ b/cdevents-sdk/src/generated/change_created.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/change_merged.rs b/cdevents-sdk/src/generated/change_merged.rs index a6f4c7e..afa2999 100644 --- a/cdevents-sdk/src/generated/change_merged.rs +++ b/cdevents-sdk/src/generated/change_merged.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/change_reviewed.rs b/cdevents-sdk/src/generated/change_reviewed.rs index a6f4c7e..afa2999 100644 --- a/cdevents-sdk/src/generated/change_reviewed.rs +++ b/cdevents-sdk/src/generated/change_reviewed.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/change_updated.rs b/cdevents-sdk/src/generated/change_updated.rs index a6f4c7e..afa2999 100644 --- a/cdevents-sdk/src/generated/change_updated.rs +++ b/cdevents-sdk/src/generated/change_updated.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/environment_created.rs b/cdevents-sdk/src/generated/environment_created.rs index 62de02f..79fbb07 100644 --- a/cdevents-sdk/src/generated/environment_created.rs +++ b/cdevents-sdk/src/generated/environment_created.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/environment_deleted.rs b/cdevents-sdk/src/generated/environment_deleted.rs index 028edac..99d4138 100644 --- a/cdevents-sdk/src/generated/environment_deleted.rs +++ b/cdevents-sdk/src/generated/environment_deleted.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/environment_modified.rs b/cdevents-sdk/src/generated/environment_modified.rs index 62de02f..79fbb07 100644 --- a/cdevents-sdk/src/generated/environment_modified.rs +++ b/cdevents-sdk/src/generated/environment_modified.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/incident_detected.rs b/cdevents-sdk/src/generated/incident_detected.rs index 93ca1d7..c7bf3e1 100644 --- a/cdevents-sdk/src/generated/incident_detected.rs +++ b/cdevents-sdk/src/generated/incident_detected.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/incident_reported.rs b/cdevents-sdk/src/generated/incident_reported.rs index 3a3a152..070a784 100644 --- a/cdevents-sdk/src/generated/incident_reported.rs +++ b/cdevents-sdk/src/generated/incident_reported.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/incident_resolved.rs b/cdevents-sdk/src/generated/incident_resolved.rs index 93ca1d7..c7bf3e1 100644 --- a/cdevents-sdk/src/generated/incident_resolved.rs +++ b/cdevents-sdk/src/generated/incident_resolved.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/mod.rs b/cdevents-sdk/src/generated/mod.rs index c49590a..4efc969 100644 --- a/cdevents-sdk/src/generated/mod.rs +++ b/cdevents-sdk/src/generated/mod.rs @@ -1,4 +1,5 @@ -// code generated by cdevents/sdk-rust/generator (mod.hbs) +// @generated +// by cdevents/sdk-rust/generator (mod.hbs) use serde::de::Error; diff --git a/cdevents-sdk/src/generated/pipelinerun_finished.rs b/cdevents-sdk/src/generated/pipelinerun_finished.rs index cf0437c..dfb1ada 100644 --- a/cdevents-sdk/src/generated/pipelinerun_finished.rs +++ b/cdevents-sdk/src/generated/pipelinerun_finished.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/pipelinerun_queued.rs b/cdevents-sdk/src/generated/pipelinerun_queued.rs index e156c94..365e8bd 100644 --- a/cdevents-sdk/src/generated/pipelinerun_queued.rs +++ b/cdevents-sdk/src/generated/pipelinerun_queued.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/pipelinerun_started.rs b/cdevents-sdk/src/generated/pipelinerun_started.rs index ef5a4fe..564eeb0 100644 --- a/cdevents-sdk/src/generated/pipelinerun_started.rs +++ b/cdevents-sdk/src/generated/pipelinerun_started.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/repository_created.rs b/cdevents-sdk/src/generated/repository_created.rs index 3145c9a..8eeb683 100644 --- a/cdevents-sdk/src/generated/repository_created.rs +++ b/cdevents-sdk/src/generated/repository_created.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/repository_deleted.rs b/cdevents-sdk/src/generated/repository_deleted.rs index b1489c8..82eb5c6 100644 --- a/cdevents-sdk/src/generated/repository_deleted.rs +++ b/cdevents-sdk/src/generated/repository_deleted.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/repository_modified.rs b/cdevents-sdk/src/generated/repository_modified.rs index b1489c8..82eb5c6 100644 --- a/cdevents-sdk/src/generated/repository_modified.rs +++ b/cdevents-sdk/src/generated/repository_modified.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/service_deployed.rs b/cdevents-sdk/src/generated/service_deployed.rs index 712fc2c..048a691 100644 --- a/cdevents-sdk/src/generated/service_deployed.rs +++ b/cdevents-sdk/src/generated/service_deployed.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/service_published.rs b/cdevents-sdk/src/generated/service_published.rs index aa249a5..b894eaf 100644 --- a/cdevents-sdk/src/generated/service_published.rs +++ b/cdevents-sdk/src/generated/service_published.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/service_removed.rs b/cdevents-sdk/src/generated/service_removed.rs index aa249a5..b894eaf 100644 --- a/cdevents-sdk/src/generated/service_removed.rs +++ b/cdevents-sdk/src/generated/service_removed.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/service_rolledback.rs b/cdevents-sdk/src/generated/service_rolledback.rs index 712fc2c..048a691 100644 --- a/cdevents-sdk/src/generated/service_rolledback.rs +++ b/cdevents-sdk/src/generated/service_rolledback.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/service_upgraded.rs b/cdevents-sdk/src/generated/service_upgraded.rs index 712fc2c..048a691 100644 --- a/cdevents-sdk/src/generated/service_upgraded.rs +++ b/cdevents-sdk/src/generated/service_upgraded.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/taskrun_finished.rs b/cdevents-sdk/src/generated/taskrun_finished.rs index 9efd356..9d2fa66 100644 --- a/cdevents-sdk/src/generated/taskrun_finished.rs +++ b/cdevents-sdk/src/generated/taskrun_finished.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/taskrun_started.rs b/cdevents-sdk/src/generated/taskrun_started.rs index 835b4d0..6600fd4 100644 --- a/cdevents-sdk/src/generated/taskrun_started.rs +++ b/cdevents-sdk/src/generated/taskrun_started.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/testcaserun_finished.rs b/cdevents-sdk/src/generated/testcaserun_finished.rs index 523a0b2..d812055 100644 --- a/cdevents-sdk/src/generated/testcaserun_finished.rs +++ b/cdevents-sdk/src/generated/testcaserun_finished.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/testcaserun_queued.rs b/cdevents-sdk/src/generated/testcaserun_queued.rs index 2b879d1..06e1aff 100644 --- a/cdevents-sdk/src/generated/testcaserun_queued.rs +++ b/cdevents-sdk/src/generated/testcaserun_queued.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/testcaserun_started.rs b/cdevents-sdk/src/generated/testcaserun_started.rs index 2b879d1..06e1aff 100644 --- a/cdevents-sdk/src/generated/testcaserun_started.rs +++ b/cdevents-sdk/src/generated/testcaserun_started.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/testoutput_published.rs b/cdevents-sdk/src/generated/testoutput_published.rs index 85ff1b6..b244d46 100644 --- a/cdevents-sdk/src/generated/testoutput_published.rs +++ b/cdevents-sdk/src/generated/testoutput_published.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/testsuiterun_finished.rs b/cdevents-sdk/src/generated/testsuiterun_finished.rs index f4fc33d..aceeb10 100644 --- a/cdevents-sdk/src/generated/testsuiterun_finished.rs +++ b/cdevents-sdk/src/generated/testsuiterun_finished.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/testsuiterun_queued.rs b/cdevents-sdk/src/generated/testsuiterun_queued.rs index 009822e..49265bf 100644 --- a/cdevents-sdk/src/generated/testsuiterun_queued.rs +++ b/cdevents-sdk/src/generated/testsuiterun_queued.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cdevents-sdk/src/generated/testsuiterun_started.rs b/cdevents-sdk/src/generated/testsuiterun_started.rs index 23116ca..cd88a72 100644 --- a/cdevents-sdk/src/generated/testsuiterun_started.rs +++ b/cdevents-sdk/src/generated/testsuiterun_started.rs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/generator/README.md b/generator/README.md index 6938a84..3760e75 100644 --- a/generator/README.md +++ b/generator/README.md @@ -18,4 +18,4 @@ To generate the `subjects` into sibling crate `cdevents/src/generated` from cont ```sh cargo run -p generator -- --help cargo run -p generator -- --templates-dir "generator/templates" --jsonschema-dir "cdevents-spec/schemas" --dest "cdevents-sdk/src/generated" -``` \ No newline at end of file +``` diff --git a/generator/src/main.rs b/generator/src/main.rs index eda0ba0..532d8c8 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -52,6 +52,7 @@ fn main() -> Result<()> { .dest .join(cruet::to_snake_case(&rust_module)) .with_extension("rs"); + //TODO use a formatter like https://crates.io/crates/prettyplease? fs::write(file, code)?; variants.push(VariantInfo { context_type, @@ -64,6 +65,7 @@ fn main() -> Result<()> { let (module_name, code) = generate_module(&hbs, &variants).with_context(|| "failed to generate module")?; let file = settings.dest.join(module_name).with_extension("rs"); + //TODO use a formatter like https://crates.io/crates/prettyplease? fs::write(file, code)?; Ok(()) diff --git a/generator/templates/mod.hbs b/generator/templates/mod.hbs index 8244a10..e01a066 100644 --- a/generator/templates/mod.hbs +++ b/generator/templates/mod.hbs @@ -1,4 +1,5 @@ -// code generated by cdevents/sdk-rust/generator (mod.hbs) +// @generated +// by cdevents/sdk-rust/generator (mod.hbs) use serde::de::Error; diff --git a/generator/templates/variant.hbs b/generator/templates/variant.hbs index 7cacb0f..0b3fa2e 100644 --- a/generator/templates/variant.hbs +++ b/generator/templates/variant.hbs @@ -1,4 +1,6 @@ -// code generated by cdevents/sdk-rust/generator (subject.hbs) +// @generated +// by cdevents/sdk-rust/generator (subject.hbs) + use serde::{Serialize, Deserialize}; {{#each structs }} @@ -14,4 +16,4 @@ pub struct {{ this.type_info.type_declaration }} { {{/each}} } -{{/each}} \ No newline at end of file +{{/each}}