Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrap theUpload buffer with an AsyncRead cursor (fix #1263)#1718

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
xamgore wants to merge1 commit intoasync-graphql:master
base:master
Choose a base branch
Loading
fromxamgore:master

Conversation

xamgore
Copy link
Contributor

@xamgorexamgore commentedMay 25, 2025
edited
Loading

This crate when being compiled with:

  • unblock feature on
  • tempfile feature off

Gets an error message:

std::io::Cursor::new(self.content)
the traitAsyncRead is not implemented forstd::io::Cursor<bytes::Bytes>

Lucky us,futures_util has a wrapper type just for that.

/// Convert to a `AsyncRead`.#[cfg(feature ="unblock")]#[cfg_attr(docsrs, doc(cfg(feature ="unblock")))]pubfninto_async_read(self) ->implAsyncRead +Sync +Send +'static{#[cfg(feature ="tempfile")]{        blocking::Unblock::new(self.content)}#[cfg(not(feature ="tempfile"))]{        futures_util::io::Cursor::new(self.content)}}

It returnsfutures_io::if_std::AsyncRead. The trait is implemented for thefutures_util::io::Cursor.

…1263)This crate when being compiled with:- `unblock` feature on- `tempfile` feature offGets an error message:> std::io::Cursor::new(self.content)> the trait `AsyncRead` is not implemented for `std::io::Cursor<bytes::Bytes>`Lucky us, `futures_util` has a wrapper type just for that.
@xamgorexamgore changed the titleWrap theUpload buffer with an AsyncRead cursor (fix #1263)WIP: Wrap theUpload buffer with an AsyncRead cursor (fix #1263)May 25, 2025
@xamgorexamgore reopened thisMay 26, 2025
@xamgorexamgore changed the titleWIP: Wrap theUpload buffer with an AsyncRead cursor (fix #1263)Wrap theUpload buffer with an AsyncRead cursor (fix #1263)May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@xamgore

[8]ページ先頭

©2009-2025 Movatter.jp