pub trait Transport: TransportWithoutIO {
// Required method
fn handshake<'a>(
&mut self,
service: Service,
extra_parameters: &'a [(&'a str, Option<&'a str>)],
) -> Result<SetServiceResponse<'_>, Error>;
}
blocking-client
only.Expand description
All methods provided here must be called in the correct order according to the communication protocol
used to connect to them.
It does, however, know just enough to be able to provide a higher-level interface than would otherwise be possible.
Thus the consumer of this trait will not have to deal with packet lines at all.
Note that whenever a Read
trait or Write
trait is produced, it must be exhausted.
Required Methods§
Sourcefn handshake<'a>(
&mut self,
service: Service,
extra_parameters: &'a [(&'a str, Option<&'a str>)],
) -> Result<SetServiceResponse<'_>, Error>
fn handshake<'a>( &mut self, service: Service, extra_parameters: &'a [(&'a str, Option<&'a str>)], ) -> Result<SetServiceResponse<'_>, Error>
Initiate connection to the given service and send the given extra_parameters
along with it.
extra_parameters
are interpreted as key=value
pairs if the second parameter is Some
or as key
if it is None.
Returns the service capabilities according according to the actual Protocol it supports,
and possibly a list of refs to be obtained.
This means that asking for an unsupported protocol might result in a protocol downgrade to the given one
if TransportWithoutIO::supported_protocol_versions()
includes it.
Exhaust the returned BufReader
for a list of references in case of protocol V1
before making another request.