File tree Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ impl File {
36
36
Self { std }
37
37
}
38
38
39
+ /// Consumes `self` and returns an `async_std::fs::File`.
40
+ #[ inline]
41
+ pub fn into_std ( self ) -> fs:: File {
42
+ self . std
43
+ }
44
+
39
45
// async_std doesn't have `with_options`.
40
46
41
47
/// Attempts to sync all OS-internal metadata to disk.
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ impl File {
41
41
Self { cap_std }
42
42
}
43
43
44
+ /// Consumes `self` and returns an `async_std::fs::File`.
45
+ #[ inline]
46
+ pub fn into_std ( self ) -> fs:: File {
47
+ self . cap_std . into_std ( )
48
+ }
49
+
44
50
// async_std doesn't have `with_options`.
45
51
46
52
/// Attempts to sync all OS-internal metadata to disk.
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ impl File {
41
41
Self { std }
42
42
}
43
43
44
+ /// Consumes `self` and returns a `std::fs::File`.
45
+ #[ inline]
46
+ pub fn into_std ( self ) -> fs:: File {
47
+ self . std
48
+ }
49
+
44
50
/// Returns a new `OpenOptions` object.
45
51
///
46
52
/// This corresponds to [`std::fs::File::with_options`].
Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ impl File {
46
46
Self { cap_std }
47
47
}
48
48
49
+ /// Consumes `self` and returns a `std::fs::File`.
50
+ #[ inline]
51
+ pub fn into_std ( self ) -> fs:: File {
52
+ self . cap_std . into_std ( )
53
+ }
54
+
49
55
/// Returns a new `OpenOptions` object.
50
56
///
51
57
/// This corresponds to [`std::fs::File::with_options`].
You can’t perform that action at this time.
0 commit comments