Skip to main content

CapabilitiesResponse

Struct CapabilitiesResponse 

Source
pub struct CapabilitiesResponse<'a> { /* private fields */ }
Expand description

A builder for APT capabilities responses.

Implementations§

Source§

impl CapabilitiesResponse<'_>

Source

pub fn single_instance(self, enabled: bool) -> Self

Whether or not to advertise single-instance support.

Source

pub fn send_config(self, enabled: bool) -> Self

Whether or not to advertise send-config support.

Source

pub fn version<S: Into<String>>(self, version: S) -> Self

Sets the version string to advertise.

By default this is set to the apt-transport crate version, though this can be (should be) overridden to match the transport implementation version:

response.version(env!("CARGO_PKG_VERSION")).send().await?;
Source

pub fn pipeline(self, enabled: bool) -> Self

Whether or not to advertise pipeline support.

Source

pub fn local_only(self, enabled: bool) -> Self

Source

pub fn removable(self, enabled: bool) -> Self

Whether or not to advertise removable support.

Source

pub fn needs_cleanup(self, enabled: bool) -> Self

Whether or not to advertise needs-cleanup support.

Source

pub async fn send(self) -> Result<(), Error>

Responds with the given capabilities.

Auto Trait Implementations§

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.