Crate gix_protocol

source ·
Expand description

An abstraction over fetching a pack from the server.

This implementation hides the transport layer, statefulness and the protocol version to the fetch delegate, the actual client implementation.

§Feature Flags

§_Mutually exclusive client _

The client portion of the protocol uses gix-transport to communicate to a server. For it to be available, one of the following features must be selected.

Specifying both causes a compile error, preventing the use of --all-features.

  • blocking-client — If set, blocking command implementations are available and will use the blocking version of the gix-transport crate.
  • async-client — As above, but provides async implementations instead.

§Other

  • serde — Data structures implement serde::Serialize and serde::Deserialize.

Re-exports§

Modules§

  • V2 command abstraction to validate invocations and arguments, like a database of what we know about them.
  • fetchblocking-client or async-client
  • handshakeblocking-client or async-client
  • ls_refsblocking-client or async-client

Structs§

  • The information usually found in remote progress messages as sent by a git server during fetch, clone and push operations.

Enums§

  • A selector for V2 commands to invoke on the server for purpose of pre-invocation validation.
  • FetchConnectionblocking-client or async-client
    A way to indicate how to treat the connection underlying the transport, potentially allowing to reuse it.

Functions§

  • The name of the git client in a format suitable for presentation to a git server, using name as user-defined portion of the value.
  • fetchblocking-client or async-client
    Perform a ‘fetch’ operation with the server using transport, with delegate handling all server interactions. Note that delegate has blocking operations and thus this entire call should be on an executor which can handle that. This could be the current thread blocking, or another thread.
  • handshakeblocking-client or async-client
    Perform a handshake with the server on the other side of transport, with authenticate being used if authentication turns out to be required. extra_parameters are the parameters (name, optional value) to add to the handshake, each time it is performed in case authentication is required. progress is used to inform about what’s currently happening.
  • indicate_end_of_interactionblocking-client or async-client
    Send a message to indicate the remote side that there is nothing more to expect from us, indicating a graceful shutdown. If trace is true, all packetlines received or sent will be passed to the facilities of the gix-trace crate.
  • ls_refsblocking-client or async-client
    Invoke an ls-refs V2 command on transport, which requires a prior handshake that yielded server capabilities. prepare_ls_refs(capabilities, arguments, features) can be used to alter the ls-refs. progress is used to provide feedback. Note that prepare_ls_refs() is expected to add the (agent, Some(name)) to the list of features. If trace is true, all packetlines received or sent will be passed to the facilities of the gix-trace crate.