rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

request-response: Inconsistent documentation.

Open vnermolaev opened this issue 9 months ago • 0 comments

Summary

As part of PR #4371, methods request_response::Behaviour::add_address and request_response::Behaviour::remove_address have been deprecated however in the master branch it says that

    /// Initiates sending a request.
    /// ...
    /// > **Note**: In order for such a dialing attempt to succeed,
    /// > the `RequestResonse` protocol must either be embedded
    /// > in another `NetworkBehaviour` that provides peer and
    /// > address discovery, or known addresses of peers must be
    /// > managed via [`Behaviour::add_address`] and
    /// > [`Behaviour::remove_address`].
    pub fn send_request(&mut self, peer: &PeerId, request: TCodec::Request) -> OutboundRequestId { ...

IMO, this note is obsolete and should be removed.

Expected behavior

Documentation should not mislead.

Actual behavior

Documentation misleads into using deprecated methods.

Relevant log output

No response

Possible Solution

Correct the docstring.

Version

No response

Would you like to work on fixing this bug ?

Yes

vnermolaev avatar May 10 '24 12:05 vnermolaev