Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad37daa

Browse files
Sherlock-HoloBerrysoft
authored andcommitted
feat: implement IntoInner for PollOnce and Splice (#792)
1 parent e2ba3c9 commit ad37daa

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

compio-driver/src/sys/unix_op.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,14 @@ impl<S> PollOnce<S> {
769769
}
770770
}
771771

772+
impl<S> IntoInner for PollOnce<S> {
773+
type Inner = S;
774+
775+
fn into_inner(self) -> Self::Inner {
776+
self.fd
777+
}
778+
}
779+
772780
/// Splice data between two file descriptors.
773781
#[cfg(linux_all)]
774782
pub struct Splice<S1, S2> {
@@ -805,3 +813,12 @@ impl<S1, S2> Splice<S1, S2> {
805813
}
806814
}
807815
}
816+
817+
#[cfg(linux_all)]
818+
impl<S1, S2> IntoInner for Splice<S1, S2> {
819+
type Inner = (S1, S2);
820+
821+
fn into_inner(self) -> Self::Inner {
822+
(self.fd_in, self.fd_out)
823+
}
824+
}

0 commit comments

Comments
 (0)