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

Make file_store usable outside of oracles #587

Merged
merged 5 commits into from
Aug 9, 2023

Conversation

jeffgrunewald
Copy link
Contributor

Convert the internal FileInfo struct from file-store to have a generic "prefix" instead of an internally defined enum FileType to allow external apps/libraries that use file-store as a dependency to build FileInfos for their own types (when using for searching the S3 records for instance).

This is intended as a minimal refactor; a longer-term solution would be to implement a FileInfo trait that encapsulates the functionality in question and better exposes some common functionality used in the file store cli commands for extension (such as "listing" a collection of files into a stream, filtered by an input type and decoded)

after: A,
before: B,
) -> Result<Vec<FileInfo>>
where
F: Into<FileType> + Copy,
P: ToString + std::fmt::Display,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this Display bound is unnecessary.

Generally, I would not suggest having things impl ToString, and instead just have the function take a &str

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed; i thought we had steered toward a slightly more permissive impl ToString and impl AsRef<str> but maybe i'm thinking of something else

@jeffgrunewald jeffgrunewald merged commit 55d077f into main Aug 9, 2023
@jeffgrunewald jeffgrunewald deleted the jg/file-store-refactor branch August 9, 2023 21:46
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.

4 participants