gix_transport::client::capabilities

Struct Capability

source
pub struct Capability<'a>(/* private fields */);
Expand description

The name of a single capability.

Implementations§

source§

impl<'a> Capability<'a>

source

pub fn name(&self) -> &'a BStr

Returns the name of the capability.

Most capabilities only consist of a name, making them appear like a feature toggle.

source

pub fn value(&self) -> Option<&'a BStr>

Returns the value associated with the capability.

Note that the caller must know whether a single or multiple values are expected, in which case values() should be called.

source

pub fn values(&self) -> Option<impl Iterator<Item = &'a BStr>>

Returns the values of a capability if its value() is space separated.

source

pub fn supports(&self, want: impl Into<&'a BStr>) -> Option<bool>

Returns true if its space-separated value() contains the given wanted capability.

Auto Trait Implementations§

§

impl<'a> Freeze for Capability<'a>

§

impl<'a> RefUnwindSafe for Capability<'a>

§

impl<'a> Send for Capability<'a>

§

impl<'a> Sync for Capability<'a>

§

impl<'a> Unpin for Capability<'a>

§

impl<'a> UnwindSafe for Capability<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.