Crate git_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 git-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 thegit-transportcrate. -
async-client— As above, but provides async implementations instead.
Other
serde1— Data structures implementserde::Serializeandserde::Deserialize.
Re-exports
Modules
V2 command abstraction to validate invocations and arguments, like a database of what we know about them.
fetch
blocking-client or async-clienthandshake
blocking-client or async-clientls_refs
blocking-client or async-clientStructs
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.
FetchConnection
blocking-client or async-clientA 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.fetch
blocking-client or async-clientPerform 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.handshake
blocking-client or async-clientPerform 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_interaction
blocking-client or async-clientSend a message to indicate the remote side that there is nothing more to expect from us, indicating a graceful shutdown.
ls_refs
blocking-client or async-clientInvoke 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.