Crate gix_protocol

Source
Expand description

An abstraction over fetching a pack from the server.

Generally, there is the following order of operations.

§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.
  • handshake — Add implementations for performing a handshake along with the dependencies needed for it.
  • fetch — Add implementations for performing a fetch (for packs) along with the dependencies needed for it.

§Other

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

Re-exports§

Modules§

Structs§

  • The information usually found in remote progress messages as sent by a git server during fetch, clone and push operations.
  • SendFlushOnDropblocking-client or async-client
    A utility to automatically send a flush packet when the instance is dropped, assuring a graceful termination of any interaction with the server.

Enums§

  • A selector for V2 commands to invoke on the server for purpose of pre-invocation validation.

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.
  • fetch(blocking-client or async-client) and fetch
    Perform one fetch operation, relying on a transport. negotiate is used to run the negotiation of objects that should be contained in the pack, if one is to be received. progress and should_interrupt is passed to all potentially long-running parts of the operation.
  • handshake(blocking-client or async-client) and handshake
    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.

Type Aliases§

  • A function that performs a given credential action, trying to obtain credentials for an operation that needs it.