Struct KeyserverClient

Source
pub struct KeyserverClient<S> { /* private fields */ }
Expand description

KeyserverClient allows queries to specific keyservers.

Implementations§

Source§

impl<S> KeyserverClient<S>

Source

pub fn from_service(service: S) -> KeyserverClient<S>

Create a new client from a Service.

Source§

impl KeyserverClient<Client<HttpConnector>>

Source

pub fn new() -> KeyserverClient<Client<HttpConnector>>

Create a new HTTP client.

Source§

impl KeyserverClient<Client<HttpsConnector<HttpConnector>>>

Source

pub fn new_tls() -> KeyserverClient<Client<HttpsConnector<HttpConnector>>>

Create new HTTPS client.

Source§

impl<S> KeyserverClient<S>
where KeyserverClient<S>: Service<(Uri, GetPeers), Response = Peers> + Sync + Clone + Send + 'static, <KeyserverClient<S> as Service<(Uri, GetPeers)>>::Error: Display + Error, <KeyserverClient<S> as Service<(Uri, GetPeers)>>::Future: Send + Sync + 'static,

Source

pub async fn get_peers( &self, keyserver_url: &str, ) -> Result<Peers, KeyserverError<<KeyserverClient<S> as Service<(Uri, GetPeers)>>::Error>>

Get Peers from a keyserver.

Source§

impl<S> KeyserverClient<S>

Source

pub async fn get_metadata( &self, keyserver_url: &str, address: &str, ) -> Result<MetadataPackage, KeyserverError<<KeyserverClient<S> as Service<(Uri, GetMetadata)>>::Error>>

Get AddressMetadata from a server. The result is wrapped in MetadataPackage.

Source§

impl<S> KeyserverClient<S>
where KeyserverClient<S>: Service<(Uri, PutMetadata), Response = ()> + Sync + Clone + Send + 'static, <KeyserverClient<S> as Service<(Uri, PutMetadata)>>::Error: Display + Error, <KeyserverClient<S> as Service<(Uri, PutMetadata)>>::Future: Send + Sync + 'static,

Source

pub async fn put_metadata( &self, keyserver_url: &str, address: &str, auth_wrapper: AuthWrapper, token: String, ) -> Result<(), KeyserverError<<KeyserverClient<S> as Service<(Uri, PutMetadata)>>::Error>>

Put AuthWrapper to a keyserver.

Source§

impl<S> KeyserverClient<S>

Source

pub async fn put_raw_metadata( &self, keyserver_url: &str, address: &str, raw_auth_wrapper: Vec<u8>, token: String, ) -> Result<(), KeyserverError<<KeyserverClient<S> as Service<(Uri, PutRawAuthWrapper)>>::Error>>

Put raw AuthWrapper to a keyserver.

Trait Implementations§

Source§

impl<S> Clone for KeyserverClient<S>
where S: Clone,

Source§

fn clone(&self) -> KeyserverClient<S>

Returns a duplicate 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<S> Debug for KeyserverClient<S>
where S: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for KeyserverClient<Client<HttpConnector>>

Source§

fn default() -> KeyserverClient<Client<HttpConnector>>

Returns the “default value” for a type. Read more
Source§

impl<S> Service<(Uri, GetMetadata)> for KeyserverClient<S>
where S: Service<Request<Body>, Response = Response<Body>> + Send + Clone + 'static, <S as Service<Request<Body>>>::Future: Send, <S as Service<Request<Body>>>::Error: Debug + Display,

Source§

type Response = MetadataPackage

Responses given by the service.
Source§

type Error = GetMetadataError<<S as Service<Request<Body>>>::Error>

Errors produced by the service.
Source§

type Future = Pin<Box<dyn Future<Output = Result<<KeyserverClient<S> as Service<(Uri, GetMetadata)>>::Response, <KeyserverClient<S> as Service<(Uri, GetMetadata)>>::Error>> + Send>>

The future response value.
Source§

fn poll_ready( &mut self, context: &mut Context<'_>, ) -> Poll<Result<(), <KeyserverClient<S> as Service<(Uri, GetMetadata)>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call( &mut self, _: (Uri, GetMetadata), ) -> <KeyserverClient<S> as Service<(Uri, GetMetadata)>>::Future

Process the request and return the response asynchronously. Read more
Source§

impl<S> Service<(Uri, GetPeers)> for KeyserverClient<S>
where S: Service<Request<Body>, Response = Response<Body>> + Send + Clone + 'static, <S as Service<Request<Body>>>::Error: Debug + Display, <S as Service<Request<Body>>>::Future: Send,

Source§

type Response = Peers

Responses given by the service.
Source§

type Error = GetPeersError<<S as Service<Request<Body>>>::Error>

Errors produced by the service.
Source§

type Future = Pin<Box<dyn Future<Output = Result<<KeyserverClient<S> as Service<(Uri, GetPeers)>>::Response, <KeyserverClient<S> as Service<(Uri, GetPeers)>>::Error>> + Send>>

The future response value.
Source§

fn poll_ready( &mut self, context: &mut Context<'_>, ) -> Poll<Result<(), <KeyserverClient<S> as Service<(Uri, GetPeers)>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call( &mut self, _: (Uri, GetPeers), ) -> <KeyserverClient<S> as Service<(Uri, GetPeers)>>::Future

Process the request and return the response asynchronously. Read more
Source§

impl<S> Service<(Uri, GetRawAuthWrapper)> for KeyserverClient<S>
where S: Service<Request<Body>, Response = Response<Body>> + Send + Clone + 'static, <S as Service<Request<Body>>>::Future: Send, <S as Service<Request<Body>>>::Error: Debug + Display,

Source§

type Response = RawAuthWrapperPackage

Responses given by the service.
Source§

type Error = GetRawAuthWrapperError<<S as Service<Request<Body>>>::Error>

Errors produced by the service.
Source§

type Future = Pin<Box<dyn Future<Output = Result<<KeyserverClient<S> as Service<(Uri, GetRawAuthWrapper)>>::Response, <KeyserverClient<S> as Service<(Uri, GetRawAuthWrapper)>>::Error>> + Send>>

The future response value.
Source§

fn poll_ready( &mut self, context: &mut Context<'_>, ) -> Poll<Result<(), <KeyserverClient<S> as Service<(Uri, GetRawAuthWrapper)>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call( &mut self, _: (Uri, GetRawAuthWrapper), ) -> <KeyserverClient<S> as Service<(Uri, GetRawAuthWrapper)>>::Future

Process the request and return the response asynchronously. Read more
Source§

impl<S> Service<(Uri, PutMetadata)> for KeyserverClient<S>
where S: Service<Request<Body>, Response = Response<Body>> + Send + Clone + 'static, <S as Service<Request<Body>>>::Error: Debug + Display, <S as Service<Request<Body>>>::Future: Send,

Source§

type Response = ()

Responses given by the service.
Source§

type Error = PutMetadataError<<S as Service<Request<Body>>>::Error>

Errors produced by the service.
Source§

type Future = Pin<Box<dyn Future<Output = Result<<KeyserverClient<S> as Service<(Uri, PutMetadata)>>::Response, <KeyserverClient<S> as Service<(Uri, PutMetadata)>>::Error>> + Send>>

The future response value.
Source§

fn poll_ready( &mut self, context: &mut Context<'_>, ) -> Poll<Result<(), <KeyserverClient<S> as Service<(Uri, PutMetadata)>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call( &mut self, _: (Uri, PutMetadata), ) -> <KeyserverClient<S> as Service<(Uri, PutMetadata)>>::Future

Process the request and return the response asynchronously. Read more
Source§

impl<S> Service<(Uri, PutRawAuthWrapper)> for KeyserverClient<S>
where S: Service<Request<Body>, Response = Response<Body>> + Send + Clone + 'static, <S as Service<Request<Body>>>::Error: Debug + Display, <S as Service<Request<Body>>>::Future: Send,

Source§

type Response = ()

Responses given by the service.
Source§

type Error = PutMetadataError<<S as Service<Request<Body>>>::Error>

Errors produced by the service.
Source§

type Future = Pin<Box<dyn Future<Output = Result<<KeyserverClient<S> as Service<(Uri, PutRawAuthWrapper)>>::Response, <KeyserverClient<S> as Service<(Uri, PutRawAuthWrapper)>>::Error>> + Send>>

The future response value.
Source§

fn poll_ready( &mut self, context: &mut Context<'_>, ) -> Poll<Result<(), <KeyserverClient<S> as Service<(Uri, PutRawAuthWrapper)>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call( &mut self, _: (Uri, PutRawAuthWrapper), ) -> <KeyserverClient<S> as Service<(Uri, PutRawAuthWrapper)>>::Future

Process the request and return the response asynchronously. Read more
Source§

impl<S, T> Service<SampleRequest<T>> for KeyserverClient<S>
where T: Send + 'static + Clone, S: Send + Clone + 'static, KeyserverClient<S>: Service<(Uri, T)>, <KeyserverClient<S> as Service<(Uri, T)>>::Response: Send + Debug, <KeyserverClient<S> as Service<(Uri, T)>>::Error: Debug + Display + Send, <KeyserverClient<S> as Service<(Uri, T)>>::Future: Send,

Source§

type Response = Vec<(Uri, Result<<KeyserverClient<S> as Service<(Uri, T)>>::Response, <KeyserverClient<S> as Service<(Uri, T)>>::Error>)>

Responses given by the service.
Source§

type Error = SampleError<<KeyserverClient<S> as Service<(Uri, T)>>::Error>

Errors produced by the service.
Source§

type Future = Pin<Box<dyn Future<Output = Result<<KeyserverClient<S> as Service<SampleRequest<T>>>::Response, <KeyserverClient<S> as Service<SampleRequest<T>>>::Error>> + Send>>

The future response value.
Source§

fn poll_ready( &mut self, context: &mut Context<'_>, ) -> Poll<Result<(), <KeyserverClient<S> as Service<SampleRequest<T>>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call( &mut self, _: SampleRequest<T>, ) -> <KeyserverClient<S> as Service<SampleRequest<T>>>::Future

Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

§

impl<S> Freeze for KeyserverClient<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for KeyserverClient<S>
where S: RefUnwindSafe,

§

impl<S> Send for KeyserverClient<S>
where S: Send,

§

impl<S> Sync for KeyserverClient<S>
where S: Sync,

§

impl<S> Unpin for KeyserverClient<S>
where S: Unpin,

§

impl<S> UnwindSafe for KeyserverClient<S>
where S: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, Request> ServiceExt<Request> for T
where T: Service<Request> + ?Sized,

Source§

fn ready(&mut self) -> Ready<'_, Self, Request>
where Self: Sized,

👎Deprecated since 0.3.1: prefer ready_and which yields the service
Resolves when the service is ready to accept a request.
Source§

fn ready_and(&mut self) -> ReadyAnd<'_, Self, Request>
where Self: Sized,

Yields a mutable reference to the service when it is ready to accept a request.
Source§

fn ready_oneshot(self) -> ReadyOneshot<Self, Request>
where Self: Sized,

Yields the service when it is ready to accept a request.
Source§

fn oneshot(self, req: Request) -> Oneshot<Self, Request>
where Self: Sized,

Consume this Service, calling with the providing request once it is ready.
Source§

fn call_all<S>(self, reqs: S) -> CallAll<Self, S>
where Self: Sized, Self::Error: Into<Box<dyn Error + Sync + Send>>, S: Stream<Item = Request>,

Process all requests from the given Stream, and produce a Stream of their responses. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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