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

implement read trait for assets for full reader functionality #24

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

JanFalkin
Copy link
Collaborator

No description provided.


use std::io::{ErrorKind, Read, SeekFrom};

pub struct FabricSteamReader<'a> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I hope this is just a typo...

Suggested change
pub struct FabricSteamReader<'a> {
pub struct FabricStreamReader<'a> {

Copy link

@elv-nate elv-nate left a comment

Choose a reason for hiding this comment

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

Some notes on this. It seems reasonable on the whole. I didn't have a ton of time to dedicate to the review, however..

}

impl std::io::Seek for FabricStreamWriter<'_> {
fn seek(&mut self, pos: SeekFrom) -> Result<u64, std::io::Error> {

Choose a reason for hiding this comment

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

This should just error, right?

/// byte slice of the read stream
/// [Example](https://github.com/eluv-io/elv-wasm/blob/019b88ac27635d5022c2211751f6af5957df2463/samples/objtar/src/lib.rs#L112)
///
pub fn read_stream_chunked(&'a self, stream_to_read: String, chunk_size: usize) -> CallResult {

Choose a reason for hiding this comment

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

Document on read_stream that setting a size of 0 results in the entire stream being read into memory at once.

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.

3 participants