Trait gix_protocol::fetch::delegate::Delegate
source · pub trait Delegate: DelegateBlocking {
// Required method
fn receive_pack(
&mut self,
input: impl BufRead,
progress: impl NestedProgress + 'static,
refs: &[Ref],
previous_response: &Response
) -> Result<()>;
}
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§
sourcefn receive_pack(
&mut self,
input: impl BufRead,
progress: impl NestedProgress + 'static,
refs: &[Ref],
previous_response: &Response
) -> Result<()>
fn receive_pack( &mut self, input: impl BufRead, progress: impl NestedProgress + 'static, 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.