@@ -25,10 +25,9 @@ pub(crate) enum FlockOp {
25
25
pub trait FileDescription : std:: fmt:: Debug + Any {
26
26
fn name ( & self ) -> & ' static str ;
27
27
28
- /// Reads as much as possible into the given buffer, and returns the number of bytes read.
29
- /// `ptr` is the pointer to the user supplied read buffer.
30
- /// `len` indicates how many bytes the user requested.
31
- /// `dest` is where the return value should be stored.
28
+ /// Reads as much as possible into the given buffer `ptr`.
29
+ /// `len` indicates how many bytes we should try to read.
30
+ /// `dest` is where the return value should be stored: number of bytes read, or `-1` in case of error.
32
31
fn read < ' tcx > (
33
32
& self ,
34
33
_self_ref : & FileDescriptionRef ,
@@ -41,10 +40,9 @@ pub trait FileDescription: std::fmt::Debug + Any {
41
40
throw_unsup_format ! ( "cannot read from {}" , self . name( ) ) ;
42
41
}
43
42
44
- /// Writes as much as possible from the given buffer, and returns the number of bytes written.
45
- /// `ptr` is the pointer to the user supplied read buffer.
46
- /// `len` indicates how many bytes the user requested.
47
- /// `dest` is where the return value should be stored.
43
+ /// Writes as much as possible from the given buffer `ptr`.
44
+ /// `len` indicates how many bytes we should try to write.
45
+ /// `dest` is where the return value should be stored: number of bytes written, or `-1` in case of error.
48
46
fn write < ' tcx > (
49
47
& self ,
50
48
_self_ref : & FileDescriptionRef ,
@@ -57,11 +55,9 @@ pub trait FileDescription: std::fmt::Debug + Any {
57
55
throw_unsup_format ! ( "cannot write to {}" , self . name( ) ) ;
58
56
}
59
57
60
- /// Reads as much as possible into the given buffer from a given offset,
61
- /// and returns the number of bytes read.
62
- /// `ptr` is the pointer to the user supplied read buffer.
63
- /// `len` indicates how many bytes the user requested.
64
- /// `dest` is where the return value should be stored.
58
+ /// Reads as much as possible into the given buffer `ptr` from a given offset.
59
+ /// `len` indicates how many bytes we should try to read.
60
+ /// `dest` is where the return value should be stored: number of bytes read, or `-1` in case of error.
65
61
fn pread < ' tcx > (
66
62
& self ,
67
63
_communicate_allowed : bool ,
@@ -74,11 +70,10 @@ pub trait FileDescription: std::fmt::Debug + Any {
74
70
throw_unsup_format ! ( "cannot pread from {}" , self . name( ) ) ;
75
71
}
76
72
77
- /// Writes as much as possible from the given buffer starting at a given offset,
78
- /// and returns the number of bytes written.
73
+ /// Writes as much as possible from the given buffer `ptr` starting at a given offset.
79
74
/// `ptr` is the pointer to the user supplied read buffer.
80
- /// `len` indicates how many bytes the user requested .
81
- /// `dest` is where the return value should be stored.
75
+ /// `len` indicates how many bytes we should try to write .
76
+ /// `dest` is where the return value should be stored: number of bytes written, or `-1` in case of error .
82
77
fn pwrite < ' tcx > (
83
78
& self ,
84
79
_communicate_allowed : bool ,
0 commit comments