Struct git_transport::client::Capabilities
source · pub struct Capabilities { /* private fields */ }
Expand description
A structure to represent multiple capabilities or features supported by the server.
Implementations§
source§impl Capabilities
impl Capabilities
sourcepub fn from_lines_with_version_detection<T: Read>(
rd: &mut StreamingPeekableIter<T>
) -> Result<Outcome<'_>, Error>
Available on crate feature blocking-client
only.
pub fn from_lines_with_version_detection<T: Read>( rd: &mut StreamingPeekableIter<T> ) -> Result<Outcome<'_>, Error>
blocking-client
only.Read the capabilities and version advertisement from the given packetline reader.
If Protocol::V1
was requested, or the remote decided to downgrade, the remote refs
advertisement will also be included in the Outcome
.
source§impl Capabilities
impl Capabilities
sourcepub fn from_bytes(bytes: &[u8]) -> Result<(Capabilities, usize), Error>
pub fn from_bytes(bytes: &[u8]) -> Result<(Capabilities, usize), Error>
Parse capabilities from the given bytes
.
Useful in case they are encoded within a ref
behind a null byte.
sourcepub fn from_lines(lines_buf: BString) -> Result<Capabilities, Error>
pub fn from_lines(lines_buf: BString) -> Result<Capabilities, Error>
Parse capabilities from the given a lines_buf
which is expected to be all newline separated lines
from the server.
Useful for parsing capabilities from a data sent from a server, and to avoid having to deal with blocking and async traits for as long as possible. There is no value in parsing a few bytes in a non-blocking fashion.
sourcepub fn contains(&self, feature: &str) -> bool
pub fn contains(&self, feature: &str) -> bool
Returns true of the given feature
is mentioned in this list of capabilities.
sourcepub fn capability(&self, name: &str) -> Option<Capability<'_>>
pub fn capability(&self, name: &str) -> Option<Capability<'_>>
Returns the capability with name
.
sourcepub fn iter(&self) -> impl Iterator<Item = Capability<'_>>
pub fn iter(&self) -> impl Iterator<Item = Capability<'_>>
Returns an iterator over all capabilities.
Trait Implementations§
source§impl Clone for Capabilities
impl Clone for Capabilities
source§fn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more