Skip to content

Comments

feat: add Clone implementation for EventReader#59

Merged
kornelski merged 1 commit intokornelski:mainfrom
kristof-mattei:clone
Jan 13, 2026
Merged

feat: add Clone implementation for EventReader#59
kornelski merged 1 commit intokornelski:mainfrom
kristof-mattei:clone

Conversation

@kristof-mattei
Copy link

@kristof-mattei kristof-mattei commented Jan 3, 2026

As title, I added a Clone implementation for EventReader when the source is Clone.

My use-case:

I have an in-memory stream of &[u8], and I wish to start parsing (think a SOAP header). But the body is specific in so that I don't want to parse it right now.

With this design I can have the header, and pass on the rest (think a SOAP body) to the handlers. Each handler can then decide whether they want to process it based on the header contents.

Obviously this doesn't work when you use BufReader as that one isn't Clone.

@kristof-mattei kristof-mattei marked this pull request as ready for review January 3, 2026 16:51
@kornelski kornelski merged commit 7c68469 into kornelski:main Jan 13, 2026
2 checks passed
@kornelski
Copy link
Owner

Thanks

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.

2 participants