File tree 1 file changed +13
-13
lines changed
1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -710,6 +710,19 @@ impl LocalWaker {
710
710
self . waker == other. waker
711
711
}
712
712
713
+ /// Creates a new `LocalWaker` from [`RawWaker`].
714
+ ///
715
+ /// The behavior of the returned `LocalWaker` is undefined if the contract defined
716
+ /// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
717
+ /// Therefore this method is unsafe.
718
+ #[ inline]
719
+ #[ must_use]
720
+ #[ stable( feature = "futures_api" , since = "1.36.0" ) ]
721
+ #[ rustc_const_unstable( feature = "const_waker" , issue = "102012" ) ]
722
+ pub const unsafe fn from_raw ( waker : RawWaker ) -> LocalWaker {
723
+ Self { waker }
724
+ }
725
+
713
726
/// Creates a new `LocalWaker` that does nothing when `wake` is called.
714
727
///
715
728
/// This is mostly useful for writing tests that need a [`Context`] to poll
@@ -740,19 +753,6 @@ impl LocalWaker {
740
753
WAKER
741
754
}
742
755
743
- /// Creates a new `LocalWaker` from [`RawWaker`].
744
- ///
745
- /// The behavior of the returned `LocalWaker` is undefined if the contract defined
746
- /// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
747
- /// Therefore this method is unsafe.
748
- #[ inline]
749
- #[ must_use]
750
- #[ stable( feature = "futures_api" , since = "1.36.0" ) ]
751
- #[ rustc_const_unstable( feature = "const_waker" , issue = "102012" ) ]
752
- pub const unsafe fn from_raw ( waker : RawWaker ) -> LocalWaker {
753
- Self { waker }
754
- }
755
-
756
756
/// Get a reference to the underlying [`RawWaker`].
757
757
#[ inline]
758
758
#[ must_use]
You can’t perform that action at this time.
0 commit comments