Skip to content
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

Abstract writer creation #3012

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Abstract writer creation #3012

wants to merge 5 commits into from

Conversation

i1i1
Copy link

@i1i1 i1i1 commented Jun 19, 2024

Motivation

This is second take on #2584 (first one was #2596).

This PR adds the feature of wrapping the default File writer with a user provided one. It is writer agnostic.

This change would allow (as shown in docs) to use BufWriter or some compression on top of regular file, which is supper useful if you want to have

Solution

In contrast to the #2596, PR still uses RwLock to store Writer and because of that requires users of library to implement Write for &UserWriter.

This PR changes API a bit (adds generics with default values and removes one const constructor).

@i1i1 i1i1 requested a review from a team as a code owner June 19, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant