awslabs / awslabs/aws-sdk-rust
Add serde::Serialize/serde::Deserialize to fluent_builders
- Dominant language
- Rust
- Stars
- 3.3k
- Forks
- 290
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 3
Description
### Describe the feature
It allows you to define/save models with file format supported by serde.
Once this feature is implemented you can,
- save your input to disk in your favourite file format
- load your input from disk using serde
### Use Case
It allows you to define/save models with file format supported by serde.
Once this feature is implemented you can,
- save your input to disk in your favourite file format
- load your input from disk using serde
### Proposed Solution
add new function `fn with_builder()` to any structs that implements `async fn send()`.
```rust
pub struct CopyObject {
handle: std::sync::Arc,
inner: crate::input::copy_object_input::Builder,
}
impl CopyObject {
pub(crate) fn with_builder(handle: std::sync::Arc, inner: crate::input::copy_object_input::Builder) -> Self {
Self {
handle,
inner
}
}
}
mod copy_object_input {
#[derive(std::clone::Clone, std::fmt::Debug, serde::Serialize, serde::Deserialize)]
struct Builder {
...
}
}
let s3_client = aws_sdk_s3::Client::from(config).copy_object();
let copy_object: CopyObject = s3_client
.copy_object()
.with_builder(serde_json::from_str(std::fs::read_to_string("copy_object.json").unwrap()).unwrap())
copy_object.send().await;
```
### Other Information
# Potential concerns
1. Binary size may become bigger
2. Compilation time may increase
3. You might want to add `#[cfg(feature = "serde")]` or something to address the concerns that mentioned above.
### Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### A note for the community
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue, please leave a comment
Contributor guide
Research direction
Locate the generated fluent_builders and input modules, starting with CopyObject, copy_object_input::Builder, and the methods implementing async send(). Check how builder construction and crate features are defined, then confirm that models can be serialized and deserialized and that with_builder works without requiring serde when the feature is disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100