generated from rust-lang/initiative-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
A-stdlibArea: a standard library for async RustArea: a standard library for async Rust
Description
An async version of the Seek trait:
pub trait Seek {
fn seek(&mut self, pos: SeekFrom) -> Result<u64>;
fn rewind(&mut self) -> Result<()> { ... }
fn stream_len(&mut self) -> Result<u64> { ... }
fn stream_position(&mut self) -> Result<u64> { ... }
}Prior art
futures-rs
pub trait AsyncSeek {
fn poll_seek(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
pos: SeekFrom
) -> Poll<Result<u64>>;
}Tokio
pub trait AsyncSeek {
fn start_seek(self: Pin<&mut Self>, position: SeekFrom) -> Result<()>;
fn poll_complete(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<u64>>;
}async-std
Extends futures-rs with a convenience seek function
fn seek(&mut self, pos: SeekFrom) -> ImplFuture<Result<u64>>
where
Self: Unpin,
{ ... }Misc
- random-access-storage (port of JS lib)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-stdlibArea: a standard library for async RustArea: a standard library for async Rust