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 thegix-transport
crate.async-client
— As above, but provides async implementations instead.
§Other
serde
— Data structures implementserde::Serialize
andserde::Deserialize
.
Re-exports§
pub use gix_credentials as credentials;
pub use gix_transport as transport;
pub use maybe_async;
Modules§
- V2 command abstraction to validate invocations and arguments, like a database of what we know about them.
- fetch
blocking-client
orasync-client
- handshake
blocking-client
orasync-client
- ls_refs
blocking-client
orasync-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.
- FetchConnection
blocking-client
orasync-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 agit
server, usingname
as user-defined portion of the value. - fetch
blocking-client
orasync-client
Perform a ‘fetch’ operation with the server usingtransport
, withdelegate
handling all server interactions. Note thatdelegate
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
orasync-client
Perform a handshake with the server on the other side oftransport
, withauthenticate
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
orasync-client
Send a message to indicate the remote side that there is nothing more to expect from us, indicating a graceful shutdown. Iftrace
istrue
, all packetlines received or sent will be passed to the facilities of thegix-trace
crate. - ls_refs
blocking-client
orasync-client
Invoke an ls-refs V2 command ontransport
, which requires a prior handshake that yielded servercapabilities
.prepare_ls_refs(capabilities, arguments, features)
can be used to alter the ls-refs.progress
is used to provide feedback. Note thatprepare_ls_refs()
is expected to add the(agent, Some(name))
to the list offeatures
. Iftrace
istrue
, all packetlines received or sent will be passed to the facilities of thegix-trace
crate.