mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-09 00:00:08 +02:00
io: clarify behavior of seeking when start_seek is not used (#7366)
This commit is contained in:
@@ -34,11 +34,17 @@ pub trait AsyncSeek {
|
|||||||
|
|
||||||
/// Waits for a seek operation to complete.
|
/// Waits for a seek operation to complete.
|
||||||
///
|
///
|
||||||
/// If the seek operation completed successfully,
|
/// If the seek operation completed successfully, this method returns the
|
||||||
/// this method returns the new position from the start of the stream.
|
/// new position from the start of the stream. That position can be used
|
||||||
/// That position can be used later with [`SeekFrom::Start`]. Repeatedly
|
/// later with [`SeekFrom::Start`].
|
||||||
/// calling this function without calling `start_seek` might return the
|
///
|
||||||
/// same result.
|
/// The position returned by calling this method can only be relied on right
|
||||||
|
/// after `start_seek`. If you have changed the position by e.g. reading or
|
||||||
|
/// writing since calling `start_seek`, then it is unspecified whether the
|
||||||
|
/// returned position takes that position change into account. Similarly, if
|
||||||
|
/// `start_seek` has never been called, then it is unspecified whether
|
||||||
|
/// `poll_complete` returns the actual position or some other placeholder
|
||||||
|
/// value (such as 0).
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user