mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
further tweak FileDescription comments
This commit is contained in:
parent
d29be1f90a
commit
fb1193078d
@ -25,10 +25,9 @@ pub(crate) enum FlockOp {
|
|||||||
pub trait FileDescription: std::fmt::Debug + Any {
|
pub trait FileDescription: std::fmt::Debug + Any {
|
||||||
fn name(&self) -> &'static str;
|
fn name(&self) -> &'static str;
|
||||||
|
|
||||||
/// Reads as much as possible into the given buffer, and returns the number of bytes read.
|
/// Reads as much as possible into the given buffer `ptr`.
|
||||||
/// `ptr` is the pointer to the user supplied read buffer.
|
/// `len` indicates how many bytes we should try to read.
|
||||||
/// `len` indicates how many bytes the user requested.
|
/// `dest` is where the return value should be stored: number of bytes read, or `-1` in case of error.
|
||||||
/// `dest` is where the return value should be stored.
|
|
||||||
fn read<'tcx>(
|
fn read<'tcx>(
|
||||||
&self,
|
&self,
|
||||||
_self_ref: &FileDescriptionRef,
|
_self_ref: &FileDescriptionRef,
|
||||||
@ -41,10 +40,9 @@ pub trait FileDescription: std::fmt::Debug + Any {
|
|||||||
throw_unsup_format!("cannot read from {}", self.name());
|
throw_unsup_format!("cannot read from {}", self.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Writes as much as possible from the given buffer, and returns the number of bytes written.
|
/// Writes as much as possible from the given buffer `ptr`.
|
||||||
/// `ptr` is the pointer to the user supplied read buffer.
|
/// `len` indicates how many bytes we should try to write.
|
||||||
/// `len` indicates how many bytes the user requested.
|
/// `dest` is where the return value should be stored: number of bytes written, or `-1` in case of error.
|
||||||
/// `dest` is where the return value should be stored.
|
|
||||||
fn write<'tcx>(
|
fn write<'tcx>(
|
||||||
&self,
|
&self,
|
||||||
_self_ref: &FileDescriptionRef,
|
_self_ref: &FileDescriptionRef,
|
||||||
@ -57,11 +55,9 @@ pub trait FileDescription: std::fmt::Debug + Any {
|
|||||||
throw_unsup_format!("cannot write to {}", self.name());
|
throw_unsup_format!("cannot write to {}", self.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reads as much as possible into the given buffer from a given offset,
|
/// Reads as much as possible into the given buffer `ptr` from a given offset.
|
||||||
/// and returns the number of bytes read.
|
/// `len` indicates how many bytes we should try to read.
|
||||||
/// `ptr` is the pointer to the user supplied read buffer.
|
/// `dest` is where the return value should be stored: number of bytes read, or `-1` in case of error.
|
||||||
/// `len` indicates how many bytes the user requested.
|
|
||||||
/// `dest` is where the return value should be stored.
|
|
||||||
fn pread<'tcx>(
|
fn pread<'tcx>(
|
||||||
&self,
|
&self,
|
||||||
_communicate_allowed: bool,
|
_communicate_allowed: bool,
|
||||||
@ -74,11 +70,10 @@ pub trait FileDescription: std::fmt::Debug + Any {
|
|||||||
throw_unsup_format!("cannot pread from {}", self.name());
|
throw_unsup_format!("cannot pread from {}", self.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Writes as much as possible from the given buffer starting at a given offset,
|
/// Writes as much as possible from the given buffer `ptr` starting at a given offset.
|
||||||
/// and returns the number of bytes written.
|
|
||||||
/// `ptr` is the pointer to the user supplied read buffer.
|
/// `ptr` is the pointer to the user supplied read buffer.
|
||||||
/// `len` indicates how many bytes the user requested.
|
/// `len` indicates how many bytes we should try to write.
|
||||||
/// `dest` is where the return value should be stored.
|
/// `dest` is where the return value should be stored: number of bytes written, or `-1` in case of error.
|
||||||
fn pwrite<'tcx>(
|
fn pwrite<'tcx>(
|
||||||
&self,
|
&self,
|
||||||
_communicate_allowed: bool,
|
_communicate_allowed: bool,
|
||||||
|
Loading…
Reference in New Issue
Block a user