Struct proget::Client

source ·
pub struct Client<A: AuthType> { /* private fields */ }
Expand description

A struct representing a user of a ProGet instance.

Most methods require authentication in order to run. For the methods that don’t, you can call Client::new_anon to make a new client without any authentication. If you’d like to run any authenticated calls, use Client::new_auth instead.

All methods on the Anon version of the client are automatically available on the Auth version, so there’s no need to make two separate clients.

Implementations§

source§

impl Client<Anon>

Functions to create and interact with ProGet without authentication.

source

pub fn new_anon(server_url: Url) -> Self

Create a new anonymous, unauthenticated client.

source

pub async fn health(&self) -> Result<Health>

Get health/status information.

source§

impl Client<Auth>

Functions to create and interact with ProGet with authentication.

source

pub fn new_auth(server_url: Url, api_token: &str) -> Self

Create a new authenticated client.

source

pub async fn upload_deb( &self, feed_name: &str, component_name: &str, deb_name: &str, deb_data: &[u8] ) -> Result<()>

Upload a .deb package.

Arguments
  • feed_name: The feed to upload the .deb package to.
  • component_name: The component in the APT repository to upload the deb to. For example, this would be bionic in deb https://proget.inedo.com deb-packages bionic.
  • deb_name: The name of the .deb file to register the package under (i.e. pkg_1.0.0-1_amd64.deb).
  • deb_data: The binary data of the .deb file.
Errors

This function returns an error if there was an issue uploading the file.

Trait Implementations§

source§

impl<A: Clone + AuthType> Clone for Client<A>

source§

fn clone(&self) -> Client<A>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Deref for Client<Auth>

Automatic conversion of an Auth client into an Anon client, which allows anonymous-access functions like Client::health to be accessed from the authenticated client.

§

type Target = Client<Anon>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<A> !RefUnwindSafe for Client<A>

§

impl<A> Send for Client<A>where A: Send,

§

impl<A> Sync for Client<A>where A: Sync,

§

impl<A> Unpin for Client<A>where A: Unpin,

§

impl<A> !UnwindSafe for Client<A>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more