Struct git_transport::client::http::Transport
source · pub struct Transport<H: Http> { /* private fields */ }
Available on crate features
blocking-client
and http-client
only.Expand description
A transport for supporting arbitrary http clients by abstracting interactions with them into the Http trait.
Implementations
Trait Implementations
sourceimpl<H: Http> TransportWithoutIO for Transport<H>
impl<H: Http> TransportWithoutIO for Transport<H>
sourcefn set_identity(&mut self, identity: Account) -> Result<(), Error>
fn set_identity(&mut self, identity: Account) -> Result<(), Error>
If the handshake or subsequent reads failed with std::io::ErrorKind::PermissionDenied, use this method to
inform the transport layer about the identity to use for subsequent calls.
If authentication continues to fail even with an identity set, consider communicating this to the provider
of the identity in order to mark it as invalid. Otherwise the user might have difficulty updating obsolete
credentials.
Please note that most transport layers are unauthenticated and thus return an error here. Read more
sourcefn request(
&mut self,
write_mode: WriteMode,
on_into_read: MessageKind
) -> Result<RequestWriter<'_>, Error>
fn request(
&mut self,
write_mode: WriteMode,
on_into_read: MessageKind
) -> Result<RequestWriter<'_>, Error>
Available on crate features
blocking-client
or async-client
only.Get a writer for sending data and obtaining the response. It can be configured in various ways
to support the task at hand.
write_mode
determines how calls to the write(…)
method are interpreted, and on_into_read
determines
which message to write when the writer is turned into the response reader using into_read()
. Read moresourcefn to_url(&self) -> String
fn to_url(&self) -> String
Returns the canonical URL pointing to the destination of this transport.
Please note that local paths may not be represented correctly, as they will go through a potentially lossy
unicode conversion. Read more
sourcefn supported_protocol_versions(&self) -> &[Protocol]
fn supported_protocol_versions(&self) -> &[Protocol]
If the actually advertised server version is contained in the returned slice or empty, continue as normal,
assume the server’s protocol version is desired or acceptable. Read more
sourcefn connection_persists_across_multiple_requests(&self) -> bool
fn connection_persists_across_multiple_requests(&self) -> bool
Returns true if the transport provides persistent connections across multiple requests, or false otherwise.
Not being persistent implies that certain information has to be resent on each ‘turn’
of the fetch negotiation or that the end of interaction (i.e. no further request will be made) has to be indicated
to the server for most graceful termination of the connection. Read more
Auto Trait Implementations
impl<H> RefUnwindSafe for Transport<H>where
H: RefUnwindSafe,
<H as Http>::ResponseBody: RefUnwindSafe,
impl<H> Send for Transport<H>where
H: Send,
<H as Http>::ResponseBody: Send,
impl<H> Sync for Transport<H>where
H: Sync,
<H as Http>::ResponseBody: Sync,
impl<H> Unpin for Transport<H>where
H: Unpin,
<H as Http>::ResponseBody: Unpin,
impl<H> UnwindSafe for Transport<H>where
H: UnwindSafe,
<H as Http>::ResponseBody: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more