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

Adding BlobDataProvider for dynamically loaded data blobs #1084

Merged
merged 11 commits into from
Sep 23, 2021

Conversation

sffc
Copy link
Member

@sffc sffc commented Sep 22, 2021

This PR builds and runs against Rust 1.56 (October 21, 2021). Unfortunately it's not just the docs tests that don't build; the code itself doesn't build.

@sffc sffc requested review from Manishearth and a team as code owners September 22, 2021 07:32
@sffc
Copy link
Member Author

sffc commented Sep 22, 2021

Design notes:

  1. The Rc<[u8]> cart passed down to the DataPayload is the one originally passed into the constructor, which is the entire blob. I had previously thought about creating a new Rc<[u8]> for each key, but decided against that.
  2. There are two separate projection steps: first from the LiteMap to &[u8], and then from &[u8] to M::Yokeable::Output. A previous commit did both of those in a single step. I split them up because (a) it allows more code to be shared between impl DataProvider and impl SerdeDeDataProvider, and (b) I intend to refactor this further in Refactor [Fs/Blob]DataProvider to unify Serde support #837.

Manishearth
Manishearth previously approved these changes Sep 22, 2021
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

Looks okay, I'm surprised this isn't causing ICEs

}
}

pub fn try_from_yoked_buffer<T, E>(
Copy link
Member

Choose a reason for hiding this comment

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

issue: docs

Copy link
Member

Choose a reason for hiding this comment

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

(and elsewhere)

no need for examples, just useful to have a one-liner about what's going on

@sffc
Copy link
Member Author

sffc commented Sep 22, 2021

Looks okay, I'm surprised this isn't causing ICEs

The ICEs are on stable but are fixed on beta. I can't check this in right now because of the ICEs.

Did you have any thoughts on the two design points in my previous comment?

@Manishearth
Copy link
Member

@sffc oh, I didn't realize those were questions. (1) is basically exactly how Yoke is supposed to be used -- it doesn't matter if the cart is referencing a wider set of data since yoke doesn't care about the cart except for the destructor. (2) is also reasonable and is what I woudl expect here especially given the upcoming refactors

@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

Manishearth
Manishearth previously approved these changes Sep 23, 2021

/// A version of [`Yoke::project_cloned`] that takes a capture and bubbles up an error
/// from the callback function.
pub fn try_project_cloned_with_capture<'this, P, T, E>(
Copy link
Member

Choose a reason for hiding this comment

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

_with_capture should be unnecessary on newer Rust -- we should be able to get away with using the fn traits, but that's a followup we can try

@sffc sffc merged commit ea4b7d9 into unicode-org:main Sep 23, 2021
@sffc sffc deleted the blob-dp branch September 23, 2021 14:55
@sffc sffc linked an issue Sep 30, 2021 that may be closed by this pull request
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.

Support non-static blobs in icu_provider_blob
2 participants