Move to intra-doc links for wasi/ext/fs.rs, os_str_bytes.rs, primitive_docs.rs & poison.rs
This commit is contained in:
parent
6ead62235a
commit
a712fbd50b
@ -20,10 +20,9 @@
|
||||
/// assert!(!bool_val);
|
||||
/// ```
|
||||
///
|
||||
/// [`assert!`]: macro.assert.html
|
||||
/// [`BitAnd`]: ops/trait.BitAnd.html
|
||||
/// [`BitOr`]: ops/trait.BitOr.html
|
||||
/// [`Not`]: ops/trait.Not.html
|
||||
/// [`BitAnd`]: ops::BitAnd
|
||||
/// [`BitOr`]: ops::BitOr
|
||||
/// [`Not`]: ops::Not
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -46,7 +45,7 @@
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// Also, since `bool` implements the [`Copy`](marker/trait.Copy.html) trait, we don't
|
||||
/// Also, since `bool` implements the [`Copy`] trait, we don't
|
||||
/// have to worry about the move semantics (just like the integer and float primitives).
|
||||
///
|
||||
/// Now an example of `bool` cast to integer type:
|
||||
@ -100,8 +99,7 @@ mod prim_bool {}
|
||||
/// at all we know it can never produce a value which isn't a [`u32`]. This illustrates another
|
||||
/// behaviour of the `!` type - expressions with type `!` will coerce into any other type.
|
||||
///
|
||||
/// [`u32`]: primitive.str.html
|
||||
/// [`exit`]: process/fn.exit.html
|
||||
/// [`exit`]: crate::process::exit
|
||||
///
|
||||
/// # `!` and generics
|
||||
///
|
||||
@ -185,14 +183,12 @@ mod prim_bool {}
|
||||
/// ever stops, it means that an error occurred. We don't even have to wrap the loop in an `Ok`
|
||||
/// because `!` coerces to `Result<!, ConnectionError>` automatically.
|
||||
///
|
||||
/// [`String::from_str`]: str/trait.FromStr.html#tymethod.from_str
|
||||
/// [`Result<String, !>`]: result/enum.Result.html
|
||||
/// [`Result<T, !>`]: result/enum.Result.html
|
||||
/// [`Result<!, E>`]: result/enum.Result.html
|
||||
/// [`Ok`]: result/enum.Result.html#variant.Ok
|
||||
/// [`String`]: string/struct.String.html
|
||||
/// [`Err`]: result/enum.Result.html#variant.Err
|
||||
/// [`FromStr`]: str/trait.FromStr.html
|
||||
/// [`String::from_str`]: str::FromStr::from_str
|
||||
/// [`Result<String, !>`]: Result
|
||||
/// [`Result<T, !>`]: Result
|
||||
/// [`Result<!, E>`]: Result
|
||||
/// [`String`]: string::String
|
||||
/// [`FromStr`]: str::FromStr
|
||||
///
|
||||
/// # `!` and traits
|
||||
///
|
||||
@ -233,11 +229,9 @@ mod prim_bool {}
|
||||
/// `impl` for this which simply panics, but the same is true for any type (we could `impl
|
||||
/// Default` for (eg.) [`File`] by just making [`default()`] panic.)
|
||||
///
|
||||
/// [`fmt::Result`]: fmt/type.Result.html
|
||||
/// [`File`]: fs/struct.File.html
|
||||
/// [`Debug`]: fmt/trait.Debug.html
|
||||
/// [`Default`]: default/trait.Default.html
|
||||
/// [`default()`]: default/trait.Default.html#tymethod.default
|
||||
/// [`File`]: fs::File
|
||||
/// [`Debug`]: fmt::Debug
|
||||
/// [`default()`]: Default::default
|
||||
///
|
||||
#[unstable(feature = "never_type", issue = "35121")]
|
||||
mod prim_never {}
|
||||
@ -360,7 +354,7 @@ mod prim_unit {}
|
||||
//
|
||||
/// Raw, unsafe pointers, `*const T`, and `*mut T`.
|
||||
///
|
||||
/// *[See also the `std::ptr` module](ptr/index.html).*
|
||||
/// *[See also the `std::ptr` module][`crate::ptr`].*
|
||||
///
|
||||
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
|
||||
/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
|
||||
@ -439,13 +433,13 @@ mod prim_unit {}
|
||||
/// but C APIs hand out a lot of pointers generally, so are a common source
|
||||
/// of raw pointers in Rust.
|
||||
///
|
||||
/// [`null`]: ../std/ptr/fn.null.html
|
||||
/// [`null_mut`]: ../std/ptr/fn.null_mut.html
|
||||
/// [`null`]: ptr::null
|
||||
/// [`null_mut`]: ptr::null_mut
|
||||
/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
|
||||
/// [`offset`]: ../std/primitive.pointer.html#method.offset
|
||||
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw
|
||||
/// [`drop`]: ../std/mem/fn.drop.html
|
||||
/// [`write`]: ../std/ptr/fn.write.html
|
||||
/// [`into_raw`]: Box::into_raw
|
||||
/// [`drop`]: mem::drop
|
||||
/// [`write`]: ptr::write
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
mod prim_pointer {}
|
||||
|
||||
@ -458,24 +452,24 @@ mod prim_pointer {}
|
||||
///
|
||||
/// * A list with each element, i.e., `[x, y, z]`.
|
||||
/// * A repeat expression `[x; N]`, which produces an array with `N` copies of `x`.
|
||||
/// The type of `x` must be [`Copy`][copy].
|
||||
/// The type of `x` must be [`Copy`].
|
||||
///
|
||||
/// Arrays of *any* size implement the following traits if the element type allows it:
|
||||
///
|
||||
/// - [`Debug`][debug]
|
||||
/// - [`IntoIterator`][intoiterator] (implemented for `&[T; N]` and `&mut [T; N]`)
|
||||
/// - [`PartialEq`][partialeq], [`PartialOrd`][partialord], [`Eq`][eq], [`Ord`][ord]
|
||||
/// - [`Hash`][hash]
|
||||
/// - [`AsRef`][asref], [`AsMut`][asmut]
|
||||
/// - [`Borrow`][borrow], [`BorrowMut`][borrowmut]
|
||||
/// - [`Debug`]
|
||||
/// - [`IntoIterator`] (implemented for `&[T; N]` and `&mut [T; N]`)
|
||||
/// - [`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]
|
||||
/// - [`Hash`]
|
||||
/// - [`AsRef`], [`AsMut`]
|
||||
/// - [`Borrow`], [`BorrowMut`]
|
||||
///
|
||||
/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`][default] trait
|
||||
/// Arrays of sizes from 0 to 32 (inclusive) implement [`Default`] trait
|
||||
/// if the element type allows it. As a stopgap, trait implementations are
|
||||
/// statically generated up to size 32.
|
||||
///
|
||||
/// Arrays of *any* size are [`Copy`][copy] if the element type is [`Copy`][copy]
|
||||
/// and [`Clone`][clone] if the element type is [`Clone`][clone]. This works
|
||||
/// because [`Copy`][copy] and [`Clone`][clone] traits are specially known
|
||||
/// Arrays of *any* size are [`Copy`] if the element type is [`Copy`]
|
||||
/// and [`Clone`] if the element type is [`Clone`]. This works
|
||||
/// because [`Copy`] and [`Clone`] traits are specially known
|
||||
/// to the compiler.
|
||||
///
|
||||
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
|
||||
@ -483,7 +477,7 @@ mod prim_pointer {}
|
||||
/// Slices have a dynamic size and do not coerce to arrays.
|
||||
///
|
||||
/// You can move elements out of an array with a slice pattern. If you want
|
||||
/// one element, see [`mem::replace`][replace].
|
||||
/// one element, see [`mem::replace`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -535,22 +529,10 @@ mod prim_pointer {}
|
||||
/// ```
|
||||
///
|
||||
/// [slice]: primitive.slice.html
|
||||
/// [copy]: marker/trait.Copy.html
|
||||
/// [clone]: clone/trait.Clone.html
|
||||
/// [debug]: fmt/trait.Debug.html
|
||||
/// [intoiterator]: iter/trait.IntoIterator.html
|
||||
/// [partialeq]: cmp/trait.PartialEq.html
|
||||
/// [partialord]: cmp/trait.PartialOrd.html
|
||||
/// [eq]: cmp/trait.Eq.html
|
||||
/// [ord]: cmp/trait.Ord.html
|
||||
/// [hash]: hash/trait.Hash.html
|
||||
/// [asref]: convert/trait.AsRef.html
|
||||
/// [asmut]: convert/trait.AsMut.html
|
||||
/// [borrow]: borrow/trait.Borrow.html
|
||||
/// [borrowmut]: borrow/trait.BorrowMut.html
|
||||
/// [default]: default/trait.Default.html
|
||||
/// [replace]: mem/fn.replace.html
|
||||
/// [`IntoIterator`]: iter/trait.IntoIterator.html
|
||||
/// [`Debug`]: fmt::Debug
|
||||
/// [`Hash`]: hash::Hash
|
||||
/// [`Borrow`]: borrow::Borrow
|
||||
/// [`BorrowMut`]: borrow::BorrowMut
|
||||
///
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
mod prim_array {}
|
||||
@ -563,7 +545,7 @@ mod prim_array {}
|
||||
/// means that elements are laid out so that every element is the same
|
||||
/// distance from its neighbors.
|
||||
///
|
||||
/// *[See also the `std::slice` module](slice/index.html).*
|
||||
/// *[See also the `std::slice` module][`crate::slice`].*
|
||||
///
|
||||
/// Slices are a view into a block of memory represented as a pointer and a
|
||||
/// length.
|
||||
@ -608,7 +590,7 @@ mod prim_slice {}
|
||||
//
|
||||
/// String slices.
|
||||
///
|
||||
/// *[See also the `std::str` module](str/index.html).*
|
||||
/// *[See also the `std::str` module][`crate::str`].*
|
||||
///
|
||||
/// The `str` type, also called a 'string slice', is the most primitive string
|
||||
/// type. It is usually seen in its borrowed form, `&str`. It is also the type
|
||||
@ -729,15 +711,8 @@ mod prim_str {}
|
||||
/// * [`Default`]
|
||||
/// * [`Hash`]
|
||||
///
|
||||
/// [`Clone`]: clone/trait.Clone.html
|
||||
/// [`Copy`]: marker/trait.Copy.html
|
||||
/// [`PartialEq`]: cmp/trait.PartialEq.html
|
||||
/// [`Eq`]: cmp/trait.Eq.html
|
||||
/// [`PartialOrd`]: cmp/trait.PartialOrd.html
|
||||
/// [`Ord`]: cmp/trait.Ord.html
|
||||
/// [`Debug`]: fmt/trait.Debug.html
|
||||
/// [`Default`]: default/trait.Default.html
|
||||
/// [`Hash`]: hash/trait.Hash.html
|
||||
/// [`Debug`]: fmt::Debug
|
||||
/// [`Hash`]: hash::Hash
|
||||
///
|
||||
/// Due to a temporary restriction in Rust's type system, these traits are only
|
||||
/// implemented on tuples of arity 12 or less. In the future, this may change.
|
||||
@ -810,7 +785,7 @@ mod prim_tuple {}
|
||||
///
|
||||
/// For more information on floating point numbers, see [Wikipedia][wikipedia].
|
||||
///
|
||||
/// *[See also the `std::f32::consts` module](f32/consts/index.html).*
|
||||
/// *[See also the `std::f32::consts` module][`crate::f32::consts`].*
|
||||
///
|
||||
/// [wikipedia]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
@ -819,12 +794,12 @@ mod prim_f32 {}
|
||||
#[doc(primitive = "f64")]
|
||||
/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
|
||||
///
|
||||
/// This type is very similar to [`f32`](primitive.f32.html), but has increased
|
||||
/// This type is very similar to [`f32`], but has increased
|
||||
/// precision by using twice as many bits. Please see [the documentation for
|
||||
/// `f32`](primitive.f32.html) or [Wikipedia on double precision
|
||||
/// `f32`] or [Wikipedia on double precision
|
||||
/// values][wikipedia] for more information.
|
||||
///
|
||||
/// *[See also the `std::f64::consts` module](f64/consts/index.html).*
|
||||
/// *[See also the `std::f64::consts` module][`crate::f64::consts`].*
|
||||
///
|
||||
/// [wikipedia]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
@ -945,9 +920,6 @@ mod prim_usize {}
|
||||
/// implicit reference-pointer coercion and raw pointer equality via [`ptr::eq`], while
|
||||
/// [`PartialEq`] compares values.
|
||||
///
|
||||
/// [`ptr::eq`]: ptr/fn.eq.html
|
||||
/// [`PartialEq`]: cmp/trait.PartialEq.html
|
||||
///
|
||||
/// ```
|
||||
/// use std::ptr;
|
||||
///
|
||||
@ -979,11 +951,9 @@ mod prim_usize {}
|
||||
/// * [`Borrow`]
|
||||
/// * [`Pointer`]
|
||||
///
|
||||
/// [`Copy`]: marker/trait.Copy.html
|
||||
/// [`Clone`]: clone/trait.Clone.html
|
||||
/// [`Deref`]: ops/trait.Deref.html
|
||||
/// [`Borrow`]: borrow/trait.Borrow.html
|
||||
/// [`Pointer`]: fmt/trait.Pointer.html
|
||||
/// [`Deref`]: ops::Deref
|
||||
/// [`Borrow`]: borrow::Borrow
|
||||
/// [`Pointer`]: fmt::Pointer
|
||||
///
|
||||
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
|
||||
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
|
||||
@ -992,8 +962,8 @@ mod prim_usize {}
|
||||
/// * [`DerefMut`]
|
||||
/// * [`BorrowMut`]
|
||||
///
|
||||
/// [`DerefMut`]: ops/trait.DerefMut.html
|
||||
/// [`BorrowMut`]: borrow/trait.BorrowMut.html
|
||||
/// [`DerefMut`]: ops::DerefMut
|
||||
/// [`BorrowMut`]: borrow::BorrowMut
|
||||
///
|
||||
/// The following traits are implemented on `&T` references if the underlying `T` also implements
|
||||
/// that trait:
|
||||
@ -1008,18 +978,10 @@ mod prim_usize {}
|
||||
/// * [`Hash`]
|
||||
/// * [`ToSocketAddrs`]
|
||||
///
|
||||
/// [`std::fmt`]: fmt/index.html
|
||||
/// [`fmt::Write`]: fmt/trait.Write.html
|
||||
/// [`PartialOrd`]: cmp/trait.PartialOrd.html
|
||||
/// [`Ord`]: cmp/trait.Ord.html
|
||||
/// [`PartialEq`]: cmp/trait.PartialEq.html
|
||||
/// [`Eq`]: cmp/trait.Eq.html
|
||||
/// [`AsRef`]: convert/trait.AsRef.html
|
||||
/// [`Fn`]: ops/trait.Fn.html
|
||||
/// [`FnMut`]: ops/trait.FnMut.html
|
||||
/// [`FnOnce`]: ops/trait.FnOnce.html
|
||||
/// [`Hash`]: hash/trait.Hash.html
|
||||
/// [`ToSocketAddrs`]: net/trait.ToSocketAddrs.html
|
||||
/// [`std::fmt`]: fmt
|
||||
/// ['Pointer`]: fmt::Pointer
|
||||
/// [`Hash`]: hash::Hash
|
||||
/// [`ToSocketAddrs`]: net::ToSocketAddrs
|
||||
///
|
||||
/// `&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T`
|
||||
/// implements that trait:
|
||||
@ -1038,17 +1000,11 @@ mod prim_usize {}
|
||||
/// * [`Seek`]
|
||||
/// * [`BufRead`]
|
||||
///
|
||||
/// [`AsMut`]: convert/trait.AsMut.html
|
||||
/// [`Iterator`]: iter/trait.Iterator.html
|
||||
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
|
||||
/// [`ExactSizeIterator`]: iter/trait.ExactSizeIterator.html
|
||||
/// [`FusedIterator`]: iter/trait.FusedIterator.html
|
||||
/// [`TrustedLen`]: iter/trait.TrustedLen.html
|
||||
/// [`Send`]: marker/trait.Send.html
|
||||
/// [`io::Write`]: io/trait.Write.html
|
||||
/// [`Read`]: io/trait.Read.html
|
||||
/// [`Seek`]: io/trait.Seek.html
|
||||
/// [`BufRead`]: io/trait.BufRead.html
|
||||
/// [`FusedIterator`]: iter::FusedIterator
|
||||
/// [`TrustedLen`]: iter::TrustedLen
|
||||
/// [`Seek`]: io::Seek
|
||||
/// [`BufRead`]: io::BufRead
|
||||
/// [`Read`]: io::Read
|
||||
///
|
||||
/// Note that due to method call deref coercion, simply calling a trait method will act like they
|
||||
/// work on references as well as they do on owned values! The implementations described here are
|
||||
@ -1063,9 +1019,9 @@ mod prim_ref {}
|
||||
///
|
||||
/// *See also the traits [`Fn`], [`FnMut`], and [`FnOnce`].*
|
||||
///
|
||||
/// [`Fn`]: ops/trait.Fn.html
|
||||
/// [`FnMut`]: ops/trait.FnMut.html
|
||||
/// [`FnOnce`]: ops/trait.FnOnce.html
|
||||
/// [`Fn`]: ops::Fn
|
||||
/// [`FnMut`]: ops::FnMut
|
||||
/// [`FnOnce`]: ops::FnOnce
|
||||
///
|
||||
/// Function pointers are pointers that point to *code*, not data. They can be called
|
||||
/// just like functions. Like references, function pointers are, among other things, assumed to
|
||||
@ -1177,14 +1133,8 @@ mod prim_ref {}
|
||||
/// * [`Pointer`]
|
||||
/// * [`Debug`]
|
||||
///
|
||||
/// [`Clone`]: clone/trait.Clone.html
|
||||
/// [`PartialEq`]: cmp/trait.PartialEq.html
|
||||
/// [`Eq`]: cmp/trait.Eq.html
|
||||
/// [`PartialOrd`]: cmp/trait.PartialOrd.html
|
||||
/// [`Ord`]: cmp/trait.Ord.html
|
||||
/// [`Hash`]: hash/trait.Hash.html
|
||||
/// [`Pointer`]: fmt/trait.Pointer.html
|
||||
/// [`Debug`]: fmt/trait.Debug.html
|
||||
/// [`Hash`]: hash::Hash
|
||||
/// [`Pointer`]: fmt::Pointer
|
||||
///
|
||||
/// Due to a temporary restriction in Rust's type system, these traits are only implemented on
|
||||
/// functions that take 12 arguments or less, with the `"Rust"` and `"C"` ABIs. In the future, this
|
||||
@ -1193,7 +1143,5 @@ mod prim_ref {}
|
||||
/// In addition, function pointers of *any* signature, ABI, or safety are [`Copy`], and all *safe*
|
||||
/// function pointers implement [`Fn`], [`FnMut`], and [`FnOnce`]. This works because these traits
|
||||
/// are specially known to the compiler.
|
||||
///
|
||||
/// [`Copy`]: marker/trait.Copy.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
mod prim_fn {}
|
||||
|
@ -9,8 +9,6 @@ use crate::sys::fs::osstr2str;
|
||||
use crate::sys_common::{AsInner, AsInnerMut, FromInner};
|
||||
|
||||
/// WASI-specific extensions to [`File`].
|
||||
///
|
||||
/// [`File`]: ../../../../std/fs/struct.File.html
|
||||
pub trait FileExt {
|
||||
/// Reads a number of bytes starting from a given offset.
|
||||
///
|
||||
@ -23,8 +21,6 @@ pub trait FileExt {
|
||||
///
|
||||
/// Note that similar to [`File::read`], it is not an error to return with a
|
||||
/// short read.
|
||||
///
|
||||
/// [`File::read`]: ../../../../std/fs/struct.File.html#method.read
|
||||
fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
|
||||
let bufs = &mut [IoSliceMut::new(buf)];
|
||||
self.read_vectored_at(bufs, offset)
|
||||
@ -41,8 +37,6 @@ pub trait FileExt {
|
||||
///
|
||||
/// Note that similar to [`File::read_vectored`], it is not an error to
|
||||
/// return with a short read.
|
||||
///
|
||||
/// [`File::read`]: ../../../../std/fs/struct.File.html#method.read_vectored
|
||||
fn read_vectored_at(&self, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io::Result<usize>;
|
||||
|
||||
/// Reads the exact number of byte required to fill `buf` from the given offset.
|
||||
@ -54,8 +48,7 @@ pub trait FileExt {
|
||||
///
|
||||
/// Similar to [`Read::read_exact`] but uses [`read_at`] instead of `read`.
|
||||
///
|
||||
/// [`Read::read_exact`]: ../../../../std/io/trait.Read.html#method.read_exact
|
||||
/// [`read_at`]: #tymethod.read_at
|
||||
/// [`read_at`]: FileExt::read_at
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
@ -73,9 +66,6 @@ pub trait FileExt {
|
||||
/// If this function returns an error, it is unspecified how many bytes it
|
||||
/// has read, but it will never read more than would be necessary to
|
||||
/// completely fill the buffer.
|
||||
///
|
||||
/// [`ErrorKind::Interrupted`]: ../../../../std/io/enum.ErrorKind.html#variant.Interrupted
|
||||
/// [`ErrorKind::UnexpectedEof`]: ../../../../std/io/enum.ErrorKind.html#variant.UnexpectedEof
|
||||
#[stable(feature = "rw_exact_all_at", since = "1.33.0")]
|
||||
fn read_exact_at(&self, mut buf: &mut [u8], mut offset: u64) -> io::Result<()> {
|
||||
while !buf.is_empty() {
|
||||
@ -111,8 +101,6 @@ pub trait FileExt {
|
||||
///
|
||||
/// Note that similar to [`File::write`], it is not an error to return a
|
||||
/// short write.
|
||||
///
|
||||
/// [`File::write`]: ../../../../std/fs/struct.File.html#write.v
|
||||
fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
|
||||
let bufs = &[IoSlice::new(buf)];
|
||||
self.write_vectored_at(bufs, offset)
|
||||
@ -132,8 +120,6 @@ pub trait FileExt {
|
||||
///
|
||||
/// Note that similar to [`File::write_vectored`], it is not an error to return a
|
||||
/// short write.
|
||||
///
|
||||
/// [`File::write`]: ../../../../std/fs/struct.File.html#method.write_vectored
|
||||
fn write_vectored_at(&self, bufs: &[IoSlice<'_>], offset: u64) -> io::Result<usize>;
|
||||
|
||||
/// Attempts to write an entire buffer starting from a given offset.
|
||||
@ -155,8 +141,7 @@ pub trait FileExt {
|
||||
/// This function will return the first error of
|
||||
/// non-[`ErrorKind::Interrupted`] kind that [`write_at`] returns.
|
||||
///
|
||||
/// [`ErrorKind::Interrupted`]: ../../../../std/io/enum.ErrorKind.html#variant.Interrupted
|
||||
/// [`write_at`]: #tymethod.write_at
|
||||
/// [`write_at`]: FileExt::write_at
|
||||
#[stable(feature = "rw_exact_all_at", since = "1.33.0")]
|
||||
fn write_all_at(&self, mut buf: &[u8], mut offset: u64) -> io::Result<()> {
|
||||
while !buf.is_empty() {
|
||||
@ -289,8 +274,6 @@ impl FileExt for fs::File {
|
||||
}
|
||||
|
||||
/// WASI-specific extensions to [`fs::OpenOptions`].
|
||||
///
|
||||
/// [`fs::OpenOptions`]: ../../../../std/fs/struct.OpenOptions.html
|
||||
pub trait OpenOptionsExt {
|
||||
/// Pass custom `dirflags` argument to `path_open`.
|
||||
///
|
||||
@ -406,8 +389,6 @@ impl OpenOptionsExt for OpenOptions {
|
||||
}
|
||||
|
||||
/// WASI-specific extensions to [`fs::Metadata`].
|
||||
///
|
||||
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
|
||||
pub trait MetadataExt {
|
||||
/// Returns the `st_dev` field of the internal `filestat_t`
|
||||
fn dev(&self) -> u64;
|
||||
@ -448,8 +429,6 @@ impl MetadataExt for fs::Metadata {
|
||||
///
|
||||
/// Adds support for special WASI file types such as block/character devices,
|
||||
/// pipes, and sockets.
|
||||
///
|
||||
/// [`FileType`]: ../../../../std/fs/struct.FileType.html
|
||||
pub trait FileTypeExt {
|
||||
/// Returns `true` if this file type is a block device.
|
||||
fn is_block_device(&self) -> bool;
|
||||
@ -477,8 +456,6 @@ impl FileTypeExt for fs::FileType {
|
||||
}
|
||||
|
||||
/// WASI-specific extension methods for [`fs::DirEntry`].
|
||||
///
|
||||
/// [`fs::DirEntry`]: ../../../../std/fs/struct.DirEntry.html
|
||||
pub trait DirEntryExt {
|
||||
/// Returns the underlying `d_ino` field of the `dirent_t`
|
||||
fn ino(&self) -> u64;
|
||||
|
@ -232,23 +232,17 @@ impl Slice {
|
||||
}
|
||||
|
||||
/// Platform-specific extensions to [`OsString`].
|
||||
///
|
||||
/// [`OsString`]: ../../../../std/ffi/struct.OsString.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub trait OsStringExt {
|
||||
/// Creates an [`OsString`] from a byte vector.
|
||||
///
|
||||
/// See the module documentation for an example.
|
||||
///
|
||||
/// [`OsString`]: ../../../ffi/struct.OsString.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn from_vec(vec: Vec<u8>) -> Self;
|
||||
|
||||
/// Yields the underlying byte vector of this [`OsString`].
|
||||
///
|
||||
/// See the module documentation for an example.
|
||||
///
|
||||
/// [`OsString`]: ../../../ffi/struct.OsString.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn into_vec(self) -> Vec<u8>;
|
||||
}
|
||||
@ -264,23 +258,17 @@ impl OsStringExt for OsString {
|
||||
}
|
||||
|
||||
/// Platform-specific extensions to [`OsStr`].
|
||||
///
|
||||
/// [`OsStr`]: ../../../../std/ffi/struct.OsStr.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub trait OsStrExt {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
/// Creates an [`OsStr`] from a byte slice.
|
||||
///
|
||||
/// See the module documentation for an example.
|
||||
///
|
||||
/// [`OsStr`]: ../../../ffi/struct.OsStr.html
|
||||
fn from_bytes(slice: &[u8]) -> &Self;
|
||||
|
||||
/// Gets the underlying byte view of the [`OsStr`] slice.
|
||||
///
|
||||
/// See the module documentation for an example.
|
||||
///
|
||||
/// [`OsStr`]: ../../../ffi/struct.OsStr.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn as_bytes(&self) -> &[u8];
|
||||
}
|
||||
|
@ -78,8 +78,8 @@ pub struct Guard {
|
||||
/// };
|
||||
/// ```
|
||||
///
|
||||
/// [`Mutex`]: ../../std/sync/struct.Mutex.html
|
||||
/// [`RwLock`]: ../../std/sync/struct.RwLock.html
|
||||
/// [`Mutex`]: crate::sync::Mutex
|
||||
/// [`RwLock`]: crate::sync::RwLock
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct PoisonError<T> {
|
||||
guard: T,
|
||||
@ -89,12 +89,11 @@ pub struct PoisonError<T> {
|
||||
/// can occur while trying to acquire a lock, from the [`try_lock`] method on a
|
||||
/// [`Mutex`] or the [`try_read`] and [`try_write`] methods on an [`RwLock`].
|
||||
///
|
||||
/// [`Mutex`]: struct.Mutex.html
|
||||
/// [`RwLock`]: struct.RwLock.html
|
||||
/// [`TryLockResult`]: type.TryLockResult.html
|
||||
/// [`try_lock`]: struct.Mutex.html#method.try_lock
|
||||
/// [`try_read`]: struct.RwLock.html#method.try_read
|
||||
/// [`try_write`]: struct.RwLock.html#method.try_write
|
||||
/// [`Mutex`]: crate::sync::Mutex
|
||||
/// [`RwLock`]: crate::sync::RwLock
|
||||
/// [`try_lock`]: crate::sync::Mutex::try_lock
|
||||
/// [`try_read`]: crate::sync::RwLock::try_read
|
||||
/// [`try_write`]: crate::sync::RwLock::try_write
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub enum TryLockError<T> {
|
||||
/// The lock could not be acquired because another thread failed while holding
|
||||
@ -115,9 +114,7 @@ pub enum TryLockError<T> {
|
||||
/// the associated guard, and it can be acquired through the [`into_inner`]
|
||||
/// method.
|
||||
///
|
||||
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
|
||||
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
|
||||
/// [`into_inner`]: ../../std/sync/struct.PoisonError.html#method.into_inner
|
||||
/// [`into_inner`]: PoisonError::into_inner
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub type LockResult<Guard> = Result<Guard, PoisonError<Guard>>;
|
||||
|
||||
@ -126,9 +123,6 @@ pub type LockResult<Guard> = Result<Guard, PoisonError<Guard>>;
|
||||
/// For more information, see [`LockResult`]. A `TryLockResult` doesn't
|
||||
/// necessarily hold the associated guard in the [`Err`] type as the lock may not
|
||||
/// have been acquired for other reasons.
|
||||
///
|
||||
/// [`LockResult`]: ../../std/sync/type.LockResult.html
|
||||
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub type TryLockResult<Guard> = Result<Guard, TryLockError<Guard>>;
|
||||
|
||||
@ -159,8 +153,8 @@ impl<T> PoisonError<T> {
|
||||
///
|
||||
/// This is generally created by methods like [`Mutex::lock`] or [`RwLock::read`].
|
||||
///
|
||||
/// [`Mutex::lock`]: ../../std/sync/struct.Mutex.html#method.lock
|
||||
/// [`RwLock::read`]: ../../std/sync/struct.RwLock.html#method.read
|
||||
/// [`Mutex::lock`]: crate::sync::Mutex::lock
|
||||
/// [`RwLock::read`]: crate::sync::RwLock::read
|
||||
#[stable(feature = "sync_poison", since = "1.2.0")]
|
||||
pub fn new(guard: T) -> PoisonError<T> {
|
||||
PoisonError { guard }
|
||||
|
Loading…
x
Reference in New Issue
Block a user