Function git_protocol::fetch

source ·
pub fn fetch<F, D, T, P>(
    transport: T,
    delegate: D,
    authenticate: F,
    progress: P,
    fetch_mode: FetchConnection,
    agent: impl Into<String>
) -> Result<(), Error>where
    F: FnMut(Action) -> Result,
    D: Delegate,
    T: Transport,
    P: Progress,
    P::SubProgress: 'static,
Available on crate features blocking-client or async-client only.
Expand description

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.

  • authenticate(operation_to_perform) is used to receive credentials for the connection and potentially store it if the server indicates ‘permission denied’. Note that not all transport support authentication or authorization.
  • progress is used to emit progress messages.
  • name is the name of the git client to present as agent, like "my-app (v2.0)"“.

Note that depending on the delegate, the actual action performed can be ls-refs, clone or fetch.