gix_protocol::fetch::delegate

Trait 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<()>;
}
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 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Delegate> Delegate for &mut T

Source§

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

Source§

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

Source§

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

Implementors§