pub trait Delegate: DelegateBlocking {
    // Required method
    fn receive_pack(
        &mut self,
        input: impl BufRead,
        progress: impl Progress,
        refs: &[Ref],
        previous_response: &Response
    ) -> Result<()>;
}
Available on crate feature blocking-client and (crate features blocking-client or async-client) only.
Expand description

The protocol delegate is the bare minimal interface needed to fully control the fetch operation.

Implementations of this trait are controlled by code with intricate knowledge about how fetching works in protocol version V1 and V2, so you don’t have to. Everything is tucked away behind type-safety so ’nothing can go wrong’©. Runtime assertions assure invalid features or arguments don’t make it to the server in the first place. Please note that this trait mostly corresponds to what V2 would look like, even though V1 is supported as well.

Required Methods§

source

fn receive_pack( &mut self, input: impl BufRead, progress: impl Progress, refs: &[Ref], previous_response: &Response ) -> Result<()>

Receive a pack provided from the given input.

Use progress to emit your own progress messages when decoding the pack.

refs of the remote side are provided for convenience, along with the parsed previous_response response in case you want to check additional acks.

Implementations on Foreign Types§

source§

impl<T: Delegate> Delegate for Box<T>

source§

fn receive_pack( &mut self, input: impl BufRead, progress: impl Progress, refs: &[Ref], previous_response: &Response ) -> Result<()>

source§

impl<T: Delegate> Delegate for &mut T

source§

fn receive_pack( &mut self, input: impl BufRead, progress: impl Progress, refs: &[Ref], previous_response: &Response ) -> Result<()>

Implementors§