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

Add AsyncReader::try_get_tile. #34

Merged
merged 3 commits into from
Apr 10, 2024
Merged

Add AsyncReader::try_get_tile. #34

merged 3 commits into from
Apr 10, 2024

Conversation

lseelenbinder
Copy link
Member

  • Exposes the error when fetching a tile (to ensure we can distinguish between missing tiles and upstream errors).
  • Adds a TileNotFound error case.
  • Bumps version to 0.8.0.

* Exposes the error when fetching a tile (to ensure we can distinguish between missing tiles and upstream errors).
* Adds a `TileNotFound` error case.
* Bumps version to 0.8.0.
@lseelenbinder lseelenbinder self-assigned this Apr 10, 2024

/// Fetches tile bytes from the archive, exposing the underlying error
/// (if any).
pub async fn try_get_tile(&self, z: u8, x: u64, y: u64) -> PmtResult<Bytes> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

TileNotFound is not an error - I think we should have this:

Suggested change
pub async fn try_get_tile(&self, z: u8, x: u64, y: u64) -> PmtResult<Bytes> {
pub async fn try_get_tile(&self, z: u8, x: u64, y: u64) -> PmtResult<Option<Bytes>> {

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

@nyurik nyurik left a comment

Choose a reason for hiding this comment

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

looks good, thx!

@lseelenbinder lseelenbinder merged commit 2cb01c9 into main Apr 10, 2024
1 check passed
@nyurik nyurik deleted the add-try-fetch-tile branch April 10, 2024 21:01
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