Struct git_transport::client::git::Connection [−][src]
pub struct Connection<R, W> { /* fields omitted */ }
A TCP connection to either a git
daemon or a spawned git
process.
When connecting to a daemon, additional context information is sent with the first line of the handshake. Otherwise that
context is passed using command line arguments to a spawned git
process.
Implementations
impl<R, W> Connection<R, W> where
R: Read,
W: Write,
[src]
impl<R, W> Connection<R, W> where
R: Read,
W: Write,
[src]pub fn new(
read: R,
write: W,
desired_version: Protocol,
repository_path: impl Into<BString>,
virtual_host: Option<(impl Into<String>, Option<u16>)>,
mode: ConnectMode
) -> Self
[src]
pub fn new(
read: R,
write: W,
desired_version: Protocol,
repository_path: impl Into<BString>,
virtual_host: Option<(impl Into<String>, Option<u16>)>,
mode: ConnectMode
) -> Self
[src]Create a connection from the given read
and write
, asking for desired_version
as preferred protocol
and the transfer of the repository at repository_path
.
virtual_host
along with a port to which to connect to, while mode
determines the kind of endpoint to connect to.
Trait Implementations
impl<R, W> Transport for Connection<R, W> where
R: Read,
W: Write,
[src]
impl<R, W> Transport for Connection<R, W> where
R: Read,
W: Write,
[src]fn handshake(
&mut self,
service: Service
) -> Result<SetServiceResponse<'_>, Error>
[src]
fn handshake(
&mut self,
service: Service
) -> Result<SetServiceResponse<'_>, Error>
[src]Initiate connection to the given service.
Returns the service capabilities according according to the actual Protocol it supports,
and possibly a list of refs to be obtained.
This means that asking for an unsupported protocol will result in a protocol downgrade to the given one.
using the read_line(…)
function of the given BufReader.
It must be exhausted, that is, read to the end before the next method can be invoked. Read more
fn request(
&mut self,
write_mode: WriteMode,
on_into_read: MessageKind
) -> Result<RequestWriter<'_>, Error>
[src]
fn request(
&mut self,
write_mode: WriteMode,
on_into_read: MessageKind
) -> Result<RequestWriter<'_>, Error>
[src]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 more
fn close(&mut self) -> Result<(), Error>
[src]
fn close(&mut self) -> Result<(), Error>
[src]Closes the connection to indicate no further requests will be made.
fn to_url(&self) -> String
[src]
fn to_url(&self) -> String
[src]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
fn desired_protocol_version(&self) -> Protocol
[src]
fn desired_protocol_version(&self) -> Protocol
[src]Returns the protocol version that was initially desired upon connection Please note that the actual protocol might differ after the handshake was conducted in case the server did not support it. Read more
fn is_stateful(&self) -> bool
[src]
fn is_stateful(&self) -> bool
[src]Returns true if the transport is inherently stateful, or false otherwise. Not being stateful implies that certain information has to be resent on each ‘turn’ of the fetch negotiation. Read more
fn set_identity(&mut self, _identity: Identity) -> Result<(), Error>
[src]
fn set_identity(&mut self, _identity: Identity) -> Result<(), Error>
[src]If the handshake or subsequent reads failed with 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
Auto Trait Implementations
impl<R, W> RefUnwindSafe for Connection<R, W> where
R: RefUnwindSafe,
W: RefUnwindSafe,
R: RefUnwindSafe,
W: RefUnwindSafe,
impl<R, W> Send for Connection<R, W> where
R: Send,
W: Send,
R: Send,
W: Send,
impl<R, W> Sync for Connection<R, W> where
R: Sync,
W: Sync,
R: Sync,
W: Sync,
impl<R, W> Unpin for Connection<R, W> where
R: Unpin,
W: Unpin,
R: Unpin,
W: Unpin,
impl<R, W> UnwindSafe for Connection<R, W> where
R: UnwindSafe,
W: UnwindSafe,
R: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> TransportV2Ext for T where
T: Transport,
[src]
impl<T> TransportV2Ext for T where
T: Transport,
[src]