-
Notifications
You must be signed in to change notification settings - Fork 546
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
Expose the format function of DelayedFormat #1649
Comments
Hmm, feels like that would be a pretty idiosyncratic API. What are you actually trying to achieve? |
@djc, the biggest use case for me is in the formatting of strings that include a timestamp. For example, a log header that will always contain a timestamp. This operation is frequent and can be made to write to the same log buffer. Basically, it is more efficient in this case to avoid an allocation of a String. In the crate |
Alright, feel free to send a PR. |
Request for chronotope#1649 - renamed format to format_into and made it public. - added format_into_io to allow format into a `std::io::Write`. - added unittests - added benchmarks for the 3 methods, `Display`, `format_into`, and `format_into_io`.
Request for chronotope#1649 - renamed format to format_into and made it public. - added format_into_io to allow format into a `std::io::Write`. - added unittests - added benchmarks for the 3 methods, `Display`, `format_into`, and `format_into_io`.
Request for chronotope#1649 - renamed format to format_into and made it public. - added format_into_io to allow format into a `std::io::Write`. - added unittests - added benchmarks for the 3 methods, `Display`, `format_into`, and `format_into_io`.
Request for chronotope#1649 - renamed format to format_into and made it public. - added format_into_io to allow format into a `std::io::Write`. - added unittests - added benchmarks for the 3 methods, `Display`, `format_into`, and `format_into_io`.
Request for chronotope#1649 - renamed format to format_into and made it public. - added format_into_io to allow format into a `std::io::Write`. - added unittests - added benchmarks for the 3 methods, `Display`, `format_into`, and `format_into_io`.
Request for chronotope#1649 - renamed format to write-to and made it public. - added unittests - added benchmarks to compare and show `Display` is slower than `write_to` in that specific use case.
Request for chronotope#1649 - renamed format to write-to and made it public. - added unittests - added benchmarks to compare and show `Display` is slower than `write_to` in that specific use case.
Request for chronotope#1649 - renamed format to write-to and made it public. - added unittests - added benchmarks to compare and show `Display` is slower than `write_to` in that specific use case.
Request for chronotope#1649 - renamed format to write-to and made it public. - added unittests - added benchmarks to compare and show `Display` is slower than `write_to` in that specific use case.
Request for chronotope#1649 - renamed format to write-to and made it public. - added unittests - added benchmarks to compare and show `Display` is slower than `write_to` in that specific use case.
Request for #1649 - renamed format to write-to and made it public. - added unittests - added benchmarks to compare and show `Display` is slower than `write_to` in that specific use case.
It seems there is no way to format into a pre-allocated buffer with
DelayedFormat
, while this seems a regular enough use case. Can the format function ofDelayedFormat
be exposed?The text was updated successfully, but these errors were encountered: