pub trait SmartSubtransport: Send + 'static {
    // Required methods
    fn action(
        &self,
        url: &str,
        action: Service
    ) -> Result<Box<dyn SmartSubtransportStream>, Error>;
    fn close(&self) -> Result<(), Error>;
}
Expand description

Interface used by smart transports.

The full-fledged definition of transports has to deal with lots of nitty-gritty details of the git protocol, but “smart transports” largely only need to deal with read() and write() of data over a channel.

A smart subtransport is contained within an instance of a smart transport and is delegated to in order to actually conduct network activity to push or pull data from a remote.

Required Methods§

source

fn action( &self, url: &str, action: Service ) -> Result<Box<dyn SmartSubtransportStream>, Error>

Indicates that this subtransport will be performing the specified action on the specified URL.

This function is responsible for making any network connections and returns a stream which can be read and written from in order to negotiate the git protocol.

source

fn close(&self) -> Result<(), Error>

Terminates a connection with the remote.

Each subtransport is guaranteed a call to close() between calls to action(), except for the following two natural progressions of actions against a constant URL.

  1. UploadPackLs -> UploadPack
  2. ReceivePackLs -> ReceivePack

Implementors§