Skip to content

Commit

Permalink
Update doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Oct 7, 2023
1 parent 5c6b90c commit 7751f2b
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
//! [`WritableStream`](crate::WritableStream) and [`TransformStream`](crate::TransformStream).
//! It also supports converting from and into [`Stream`]s and [`Sink`]s from the [futures] crate.
//!
//! [`Stream`]: https://docs.rs/futures/0.3.18/futures/stream/trait.Stream.html
//! [`Sink`]: https://docs.rs/futures/0.3.18/futures/sink/trait.Sink.html
//! [futures]: https://docs.rs/futures/0.3.18/futures/index.html
//! [`Stream`]: https://docs.rs/futures/0.3.28/futures/stream/trait.Stream.html
//! [`Sink`]: https://docs.rs/futures/0.3.28/futures/sink/trait.Sink.html
//! [futures]: https://docs.rs/futures/0.3.28/futures/index.html

pub use readable::ReadableStream;
pub use transform::TransformStream;
Expand Down
2 changes: 1 addition & 1 deletion src/readable/byob_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<'stream> ReadableStreamBYOBReader<'stream> {
/// still usable. This allows reading only a few bytes from the `AsyncRead`, while still
/// allowing another reader to read the remaining bytes later on.
///
/// [`AsyncRead`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncRead.html
/// [`AsyncRead`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncRead.html
#[inline]
pub fn into_async_read(self) -> IntoAsyncRead<'stream> {
IntoAsyncRead::new(self, false)
Expand Down
2 changes: 1 addition & 1 deletion src/readable/default_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl<'stream> ReadableStreamDefaultReader<'stream> {
/// usable. This allows reading only a few chunks from the `Stream`, while still allowing
/// another reader to read the remaining chunks later on.
///
/// [`Stream`]: https://docs.rs/futures/0.3.18/futures/stream/trait.Stream.html
/// [`Stream`]: https://docs.rs/futures/0.3.28/futures/stream/trait.Stream.html
#[inline]
pub fn into_stream(self) -> IntoStream<'stream> {
IntoStream::new(self, false)
Expand Down
2 changes: 1 addition & 1 deletion src/readable/into_async_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use super::ReadableStreamBYOBReader;
/// When this `AsyncRead` is dropped, it also drops its reader which in turn
/// [releases its lock](https://streams.spec.whatwg.org/#release-a-lock).
///
/// [`AsyncRead`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncRead.html
/// [`AsyncRead`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncRead.html
#[must_use = "readers do nothing unless polled"]
#[derive(Debug)]
pub struct IntoAsyncRead<'reader> {
Expand Down
2 changes: 1 addition & 1 deletion src/readable/into_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use super::ReadableStreamDefaultReader;
/// When this `Stream` is dropped, it also drops its reader which in turn
/// [releases its lock](https://streams.spec.whatwg.org/#release-a-lock).
///
/// [`Stream`]: https://docs.rs/futures/0.3.18/futures/stream/trait.Stream.html
/// [`Stream`]: https://docs.rs/futures/0.3.28/futures/stream/trait.Stream.html
#[must_use = "streams do nothing unless polled"]
#[derive(Debug)]
pub struct IntoStream<'reader> {
Expand Down
36 changes: 18 additions & 18 deletions src/readable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ pub mod sys;
/// then they can be created from a Rust [`AsyncRead`] with [`from_async_read`](Self::from_async_read),
/// or converted into one with [`into_async_read`](Self::into_async_read).
///
/// [`Stream`]: https://docs.rs/futures/0.3.18/futures/stream/trait.Stream.html
/// [`AsyncRead`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncRead.html
/// [`Stream`]: https://docs.rs/futures/0.3.28/futures/stream/trait.Stream.html
/// [`AsyncRead`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncRead.html
#[derive(Debug)]
pub struct ReadableStream {
raw: sys::ReadableStream,
Expand All @@ -58,10 +58,10 @@ impl ReadableStream {
/// Use [`map`], [`map_ok`] and/or [`map_err`] to convert a stream's items to a `JsValue`
/// before passing it to this function.
///
/// [`Stream`]: https://docs.rs/futures/0.3.18/futures/stream/trait.Stream.html
/// [`map`]: https://docs.rs/futures/0.3.18/futures/stream/trait.StreamExt.html#method.map
/// [`map_ok`]: https://docs.rs/futures/0.3.18/futures/stream/trait.TryStreamExt.html#method.map_ok
/// [`map_err`]: https://docs.rs/futures/0.3.18/futures/stream/trait.TryStreamExt.html#method.map_err
/// [`Stream`]: https://docs.rs/futures/0.3.28/futures/stream/trait.Stream.html
/// [`map`]: https://docs.rs/futures/0.3.28/futures/stream/trait.StreamExt.html#method.map
/// [`map_ok`]: https://docs.rs/futures/0.3.28/futures/stream/trait.TryStreamExt.html#method.map_ok
/// [`map_err`]: https://docs.rs/futures/0.3.28/futures/stream/trait.TryStreamExt.html#method.map_err
pub fn from_stream<St>(stream: St) -> Self
where
St: Stream<Item = Result<JsValue, JsValue>> + 'static,
Expand All @@ -87,8 +87,8 @@ impl ReadableStream {
///
/// **Panics** if readable byte streams are not supported by the browser.
///
/// [`AsyncRead`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncRead.html
/// [AsyncRead::poll_read]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncRead.html#tymethod.poll_read
/// [`AsyncRead`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncRead.html
/// [AsyncRead::poll_read]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncRead.html#tymethod.poll_read
// TODO Non-panicking variant?
pub fn from_async_read<R>(async_read: R, default_buffer_len: usize) -> Self
where
Expand Down Expand Up @@ -282,10 +282,10 @@ impl ReadableStream {
/// **Panics** if the stream is already locked to a reader. For a non-panicking variant,
/// use [`try_into_stream`](Self::try_into_stream).
///
/// [`Stream`]: https://docs.rs/futures/0.3.18/futures/stream/trait.Stream.html
/// [`map`]: https://docs.rs/futures/0.3.18/futures/stream/trait.StreamExt.html#method.map
/// [`map_ok`]: https://docs.rs/futures/0.3.18/futures/stream/trait.TryStreamExt.html#method.map_ok
/// [`map_err`]: https://docs.rs/futures/0.3.18/futures/stream/trait.TryStreamExt.html#method.map_err
/// [`Stream`]: https://docs.rs/futures/0.3.28/futures/stream/trait.Stream.html
/// [`map`]: https://docs.rs/futures/0.3.28/futures/stream/trait.StreamExt.html#method.map
/// [`map_ok`]: https://docs.rs/futures/0.3.28/futures/stream/trait.TryStreamExt.html#method.map_ok
/// [`map_err`]: https://docs.rs/futures/0.3.28/futures/stream/trait.TryStreamExt.html#method.map_err
#[inline]
pub fn into_stream(self) -> IntoStream<'static> {
self.try_into_stream()
Expand All @@ -301,10 +301,10 @@ impl ReadableStream {
/// If the stream is already locked to a reader, then this returns an error
/// along with the original `ReadableStream`.
///
/// [`Stream`]: https://docs.rs/futures/0.3.18/futures/stream/trait.Stream.html
/// [`map`]: https://docs.rs/futures/0.3.18/futures/stream/trait.StreamExt.html#method.map
/// [`map_ok`]: https://docs.rs/futures/0.3.18/futures/stream/trait.TryStreamExt.html#method.map_ok
/// [`map_err`]: https://docs.rs/futures/0.3.18/futures/stream/trait.TryStreamExt.html#method.map_err
/// [`Stream`]: https://docs.rs/futures/0.3.28/futures/stream/trait.Stream.html
/// [`map`]: https://docs.rs/futures/0.3.28/futures/stream/trait.StreamExt.html#method.map
/// [`map_ok`]: https://docs.rs/futures/0.3.28/futures/stream/trait.TryStreamExt.html#method.map_ok
/// [`map_err`]: https://docs.rs/futures/0.3.28/futures/stream/trait.TryStreamExt.html#method.map_err
pub fn try_into_stream(mut self) -> Result<IntoStream<'static>, (js_sys::Error, Self)> {
let reader = ReadableStreamDefaultReader::new(&mut self).map_err(|err| (err, self))?;
Ok(IntoStream::new(reader, true))
Expand All @@ -315,7 +315,7 @@ impl ReadableStream {
/// **Panics** if the stream is already locked to a reader, or if this stream is not a readable
/// byte stream. For a non-panicking variant, use [`try_into_async_read`](Self::try_into_async_read).
///
/// [`AsyncRead`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncRead.html
/// [`AsyncRead`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncRead.html
#[inline]
pub fn into_async_read(self) -> IntoAsyncRead<'static> {
self.try_into_async_read()
Expand All @@ -327,7 +327,7 @@ impl ReadableStream {
/// If the stream is already locked to a reader, or if this stream is not a readable byte
/// stream, then this returns an error along with the original `ReadableStream`.
///
/// [`AsyncRead`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncRead.html
/// [`AsyncRead`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncRead.html
pub fn try_into_async_read(mut self) -> Result<IntoAsyncRead<'static>, (js_sys::Error, Self)> {
let reader = ReadableStreamBYOBReader::new(&mut self).map_err(|err| (err, self))?;
Ok(IntoAsyncRead::new(reader, true))
Expand Down
4 changes: 2 additions & 2 deletions src/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub mod sys;
/// using [`into_stream`](super::ReadableStream::into_stream)
/// and [`into_sink`](super::WritableStream::into_sink).
///
/// [`Stream`]: https://docs.rs/futures/0.3.18/futures/stream/trait.Stream.html
/// [`Sink`]: https://docs.rs/futures/0.3.18/futures/sink/trait.Sink.html
/// [`Stream`]: https://docs.rs/futures/0.3.28/futures/stream/trait.Stream.html
/// [`Sink`]: https://docs.rs/futures/0.3.28/futures/sink/trait.Sink.html
#[derive(Debug)]
pub struct TransformStream {
raw: sys::TransformStream,
Expand Down
4 changes: 2 additions & 2 deletions src/writable/default_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl<'stream> WritableStreamDefaultWriter<'stream> {
/// usable. This allows writing only a few chunks through the `Sink`, while still allowing
/// another writer to write more chunks later on.
///
/// [`Sink`]: https://docs.rs/futures/0.3.18/futures/sink/trait.Sink.html
/// [`Sink`]: https://docs.rs/futures/0.3.28/futures/sink/trait.Sink.html
#[inline]
pub fn into_sink(self) -> IntoSink<'stream> {
IntoSink::new(self)
Expand All @@ -132,7 +132,7 @@ impl<'stream> WritableStreamDefaultWriter<'stream> {
/// still usable. This allows writing only a few bytes through the `AsyncWrite`, while still
/// allowing another writer to write more bytes later on.
///
/// [`AsyncWrite`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncWrite.html
/// [`AsyncWrite`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncWrite.html
#[inline]
pub fn into_async_write(self) -> IntoAsyncWrite<'stream> {
IntoAsyncWrite::new(self.into_sink())
Expand Down
2 changes: 1 addition & 1 deletion src/writable/into_async_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::IntoSink;
/// When this `AsyncWrite` is dropped, it also drops its writer which in turn
/// [releases its lock](https://streams.spec.whatwg.org/#release-a-lock).
///
/// [`AsyncWrite`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncWrite.html
/// [`AsyncWrite`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncWrite.html
#[must_use = "writers do nothing unless polled"]
#[derive(Debug)]
pub struct IntoAsyncWrite<'writer> {
Expand Down
2 changes: 1 addition & 1 deletion src/writable/into_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use super::WritableStreamDefaultWriter;
/// When this sink is dropped, it also drops its writer which in turn
/// [releases its lock](https://streams.spec.whatwg.org/#release-a-lock).
///
/// [`Sink`]: https://docs.rs/futures/0.3.18/futures/sink/trait.Sink.html
/// [`Sink`]: https://docs.rs/futures/0.3.28/futures/sink/trait.Sink.html
#[must_use = "sinks do nothing unless polled"]
#[derive(Debug)]
pub struct IntoSink<'writer> {
Expand Down
24 changes: 12 additions & 12 deletions src/writable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub mod sys;
/// They can be converted into a [raw JavaScript stream](sys::WritableStream) with
/// [`into_raw`](Self::into_raw), or into a Rust [`Sink`] with [`into_sink`](Self::into_sink).
///
/// [`Sink`]: https://docs.rs/futures/0.3.18/futures/sink/trait.Sink.html
/// [`Sink`]: https://docs.rs/futures/0.3.28/futures/sink/trait.Sink.html
#[derive(Debug)]
pub struct WritableStream {
raw: sys::WritableStream,
Expand All @@ -44,9 +44,9 @@ impl WritableStream {
/// Use [`with`] and/or [`sink_map_err`] to convert a sink's items to a `JsValue`
/// before passing it to this function.
///
/// [`Sink`]: https://docs.rs/futures/0.3.18/futures/sink/trait.Sink.html
/// [`with`]: https://docs.rs/futures/0.3.18/futures/sink/trait.SinkExt.html#method.with
/// [`sink_map_err`]: https://docs.rs/futures/0.3.18/futures/sink/trait.SinkExt.html#method.sink_map_err
/// [`Sink`]: https://docs.rs/futures/0.3.28/futures/sink/trait.Sink.html
/// [`with`]: https://docs.rs/futures/0.3.28/futures/sink/trait.SinkExt.html#method.with
/// [`sink_map_err`]: https://docs.rs/futures/0.3.28/futures/sink/trait.SinkExt.html#method.sink_map_err
pub fn from_sink<Si>(sink: Si) -> Self
where
Si: Sink<JsValue, Error = JsValue> + 'static,
Expand Down Expand Up @@ -126,9 +126,9 @@ impl WritableStream {
/// **Panics** if the stream is already locked to a writer. For a non-panicking variant,
/// use [`try_into_sink`](Self::try_into_sink).
///
/// [`Sink`]: https://docs.rs/futures/0.3.18/futures/sink/trait.Sink.html
/// [`with`]: https://docs.rs/futures/0.3.18/futures/sink/trait.SinkExt.html#method.with
/// [`sink_map_err`]: https://docs.rs/futures/0.3.18/futures/sink/trait.SinkExt.html#method.sink_map_err
/// [`Sink`]: https://docs.rs/futures/0.3.28/futures/sink/trait.Sink.html
/// [`with`]: https://docs.rs/futures/0.3.28/futures/sink/trait.SinkExt.html#method.with
/// [`sink_map_err`]: https://docs.rs/futures/0.3.28/futures/sink/trait.SinkExt.html#method.sink_map_err
#[inline]
pub fn into_sink(self) -> IntoSink<'static> {
self.try_into_sink()
Expand All @@ -144,9 +144,9 @@ impl WritableStream {
/// If the stream is already locked to a writer, then this returns an error
/// along with the original `WritableStream`.
///
/// [`Sink`]: https://docs.rs/futures/0.3.18/futures/sink/trait.Sink.html
/// [`with`]: https://docs.rs/futures/0.3.18/futures/sink/trait.SinkExt.html#method.with
/// [`sink_map_err`]: https://docs.rs/futures/0.3.18/futures/sink/trait.SinkExt.html#method.sink_map_err
/// [`Sink`]: https://docs.rs/futures/0.3.28/futures/sink/trait.Sink.html
/// [`with`]: https://docs.rs/futures/0.3.28/futures/sink/trait.SinkExt.html#method.with
/// [`sink_map_err`]: https://docs.rs/futures/0.3.28/futures/sink/trait.SinkExt.html#method.sink_map_err
pub fn try_into_sink(mut self) -> Result<IntoSink<'static>, (js_sys::Error, Self)> {
let writer = WritableStreamDefaultWriter::new(&mut self).map_err(|err| (err, self))?;
Ok(writer.into_sink())
Expand All @@ -159,7 +159,7 @@ impl WritableStream {
/// **Panics** if the stream is already locked to a writer. For a non-panicking variant,
/// use [`try_into_async_write`](Self::try_into_async_write).
///
/// [`AsyncWrite`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncWrite.html
/// [`AsyncWrite`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncWrite.html
pub fn into_async_write(self) -> IntoAsyncWrite<'static> {
self.try_into_async_write()
.expect_throw("already locked to a writer")
Expand All @@ -172,7 +172,7 @@ impl WritableStream {
/// If the stream is already locked to a writer, then this returns an error
/// along with the original `WritableStream`.
///
/// [`AsyncWrite`]: https://docs.rs/futures/0.3.18/futures/io/trait.AsyncWrite.html
/// [`AsyncWrite`]: https://docs.rs/futures/0.3.28/futures/io/trait.AsyncWrite.html
pub fn try_into_async_write(self) -> Result<IntoAsyncWrite<'static>, (js_sys::Error, Self)> {
Ok(IntoAsyncWrite::new(self.try_into_sink()?))
}
Expand Down

0 comments on commit 7751f2b

Please sign in to comment.