Revise the documentation for try_clone
.
On Unix, describe these in terms of the underlying "file description". On Windows, describe them in terms of the underlying "object".
This commit is contained in:
parent
5d0eae81ae
commit
007cbfd1db
@ -77,8 +77,8 @@ impl BorrowedFd<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl OwnedFd {
|
impl OwnedFd {
|
||||||
/// Creates a new `OwnedFd` instance that shares the same underlying file handle
|
/// Creates a new `OwnedFd` instance that shares the same underlying file
|
||||||
/// as the existing `OwnedFd` instance.
|
/// description as the existing `OwnedFd` instance.
|
||||||
#[stable(feature = "io_safety", since = "1.63.0")]
|
#[stable(feature = "io_safety", since = "1.63.0")]
|
||||||
pub fn try_clone(&self) -> crate::io::Result<Self> {
|
pub fn try_clone(&self) -> crate::io::Result<Self> {
|
||||||
self.as_fd().try_clone_to_owned()
|
self.as_fd().try_clone_to_owned()
|
||||||
@ -108,6 +108,8 @@ impl BorrowedFd<'_> {
|
|||||||
Ok(unsafe { OwnedFd::from_raw_fd(fd) })
|
Ok(unsafe { OwnedFd::from_raw_fd(fd) })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Creates a new `OwnedFd` instance that shares the same underlying file
|
||||||
|
/// description as the existing `BorrowedFd` instance.
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
#[stable(feature = "io_safety", since = "1.63.0")]
|
#[stable(feature = "io_safety", since = "1.63.0")]
|
||||||
pub fn try_clone_to_owned(&self) -> crate::io::Result<OwnedFd> {
|
pub fn try_clone_to_owned(&self) -> crate::io::Result<OwnedFd> {
|
||||||
|
@ -177,8 +177,8 @@ impl TryFrom<HandleOrNull> for OwnedHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl OwnedHandle {
|
impl OwnedHandle {
|
||||||
/// Creates a new `OwnedHandle` instance that shares the same underlying file handle
|
/// Creates a new `OwnedHandle` instance that shares the same underlying
|
||||||
/// as the existing `OwnedHandle` instance.
|
/// object as the existing `OwnedHandle` instance.
|
||||||
#[stable(feature = "io_safety", since = "1.63.0")]
|
#[stable(feature = "io_safety", since = "1.63.0")]
|
||||||
pub fn try_clone(&self) -> crate::io::Result<Self> {
|
pub fn try_clone(&self) -> crate::io::Result<Self> {
|
||||||
self.as_handle().try_clone_to_owned()
|
self.as_handle().try_clone_to_owned()
|
||||||
|
@ -82,8 +82,8 @@ impl BorrowedSocket<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl OwnedSocket {
|
impl OwnedSocket {
|
||||||
/// Creates a new `OwnedSocket` instance that shares the same underlying socket
|
/// Creates a new `OwnedSocket` instance that shares the same underlying
|
||||||
/// as the existing `OwnedSocket` instance.
|
/// object as the existing `OwnedSocket` instance.
|
||||||
#[stable(feature = "io_safety", since = "1.63.0")]
|
#[stable(feature = "io_safety", since = "1.63.0")]
|
||||||
pub fn try_clone(&self) -> io::Result<Self> {
|
pub fn try_clone(&self) -> io::Result<Self> {
|
||||||
self.as_socket().try_clone_to_owned()
|
self.as_socket().try_clone_to_owned()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user