pub struct ReadEnd<Buffer: ToBuffer + 'static> { /* private fields */ }

Implementations

Precondition: self.wait_for_new_request() must not be 0.

Example
let readend = ...;
loop {
    let new_requests_submit = readend.wait_for_new_request().await;
    if new_requests_submit == 0 {
        break;
    }

    // If attempt to read in more than new_requests_submit, then
    // `read_in_one_packet` might block forever.
    for _ in 0..new_requests_submit {
        readend.read_in_one_packet().await.unwrap();
    }
}

Return number of requests sent and number of responses to read in. Read 0 if the connection is closed.

You must call this function in a loop, break if this function returns 0, otherwise call read_in_one_packet for n times where n in the return value of this function, then repeat.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.