Struct gitoxide_core::pack::receive::Response
pub struct Response { /* private fields */ }
async-client
or blocking-client
only.Expand description
A representation of a complete fetch response
Implementations§
§impl Response
impl Response
pub fn check_required_features(
version: Protocol,
features: &[(&'static str, Option<Cow<'static, str>>)]
) -> Result<(), Error>
pub fn check_required_features( version: Protocol, features: &[(&'static str, Option<Cow<'static, str>>)] ) -> Result<(), Error>
Return an error if the given features
don’t contain the required ones (the ones this implementation needs)
for the given version
of the protocol.
Even though technically any set of features supported by the server could work, we only implement the ones that make it easy to maintain all versions with a single code base that aims to be and remain maintainable.
pub fn acknowledgements(&self) -> &[Acknowledgement]
pub fn acknowledgements(&self) -> &[Acknowledgement]
Return all acknowledgements parsed previously.
pub fn shallow_updates(&self) -> &[ShallowUpdate]
pub fn shallow_updates(&self) -> &[ShallowUpdate]
Return all shallow update lines parsed previously.
pub fn wanted_refs(&self) -> &[WantedRef]
pub fn wanted_refs(&self) -> &[WantedRef]
Return all wanted-refs parsed previously.
§impl Response
impl Response
pub fn from_line_reader(
version: Protocol,
reader: &mut impl ExtendedBufRead,
client_expects_pack: bool
) -> Result<Response, Error>
pub fn from_line_reader( version: Protocol, reader: &mut impl ExtendedBufRead, client_expects_pack: bool ) -> Result<Response, Error>
Parse a response of the given version
of the protocol from reader
.
client_expects_pack
is only relevant for V1 stateful connections, and if false
, causes us to stop parsing when seeing NAK
,
and if true
we will keep parsing until we get a pack as the client already signalled to the server that it’s done.
This way of doing things allows us to exploit knowledge about more recent versions of the protocol, which keeps code easier
and more localized without having to support all the cruft that there is.