-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(profiling)!: create FFI Error type and remove *Result_drop
methods
#95
Merged
Commits on Jan 25, 2023
-
refactor(profiling)!: create FFI Error type
This extracts an FFI Error type `ddog_Error`. It contains an FFI Vec internally: ```rust /// Please treat this as opaque; do not reach into it, and especially /// don't write into it! pub struct Error { /// This is a String stuffed into the vec. message: Vec<u8>, } ``` FFI result types have been updated e.g.: ```rust pub enum SendResult { HttpResponse(HttpStatus), Err(Error), } ``` Instead of reaching into the buffer, use these APIs: ```c /** * # Safety * Only pass null or a valid reference to an Error. */ void ddog_Error_drop(struct ddog_Error *error); /** * Returns a CharSlice of the error's message that is valid until the error * is dropped. * # Safety * Only pass null or a valid reference to an Error. */ ddog_CharSlice ddog_Error_message(const struct ddog_Error *error); ```
Configuration menu - View commit details
-
Copy full SHA for 9b51061 - Browse repository at this point
Copy the full SHA 9b51061View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c57983 - Browse repository at this point
Copy the full SHA 9c57983View commit details
Commits on Jan 26, 2023
-
I think API usage is more likely to be correct when each case is dropped as needed. This shows the diff for our examples.
Configuration menu - View commit details
-
Copy full SHA for 0b7899b - Browse repository at this point
Copy the full SHA 0b7899bView commit details -
Configuration menu - View commit details
-
Copy full SHA for f36696f - Browse repository at this point
Copy the full SHA f36696fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e130a2c - Browse repository at this point
Copy the full SHA e130a2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 15626b9 - Browse repository at this point
Copy the full SHA 15626b9View commit details
Commits on Jan 27, 2023
-
Configuration menu - View commit details
-
Copy full SHA for ae15ef2 - Browse repository at this point
Copy the full SHA ae15ef2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 05555e4 - Browse repository at this point
Copy the full SHA 05555e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for ccaceb2 - Browse repository at this point
Copy the full SHA ccaceb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for f47f2a0 - Browse repository at this point
Copy the full SHA f47f2a0View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.