Enum nbio::WriteStatus
source · pub enum WriteStatus<'a, T: ?Sized> {
Success,
Pending(&'a T),
}Expand description
Returned by the Session write function, providing the outcome of the write action.
The generic type T will match the cooresponding Session::ReadData.
Variants§
Success
The write action completed fully
Pending(&'a T)
The write action was not performed or was partially performed.
The returned reference must be passed back into the Session write function for the write action to complete.
Whether or not the returned reference may consist of partial data depends on the Session implementation.
If you are looking for a general retry pattern, it is always safe to finish the write by passing this returned
reference back into the write function for another attempt, but it is only sometimes appropriate to return the entire
original write reference into the write function for a second attempt.