HttpForwarderService

Struct HttpForwarderService 

Source
pub struct HttpForwarderService<B>
where B: Body,
{ /* private fields */ }
Expand description

Forward HTTP requests over a connection stream

Implementations§

Source§

impl<B> HttpForwarderService<B>
where B: Body<Data = Bytes, Error = Infallible> + Send + 'static,

Source

pub async fn http<T>(stream: T) -> Result<HttpForwarderService<B>>
where T: AsyncRead + AsyncWrite + Unpin + Sync + Send + 'static,

Forward HTTP requests over a connection stream

Source

pub async fn https<T>( domain: &str, stream: T, ) -> Result<HttpForwarderService<B>>
where T: AsyncRead + AsyncWrite + Unpin + Sync + Send + 'static,

Wrap the connection stream in TLS and forward HTTP requests over it The domain is used to verify the TLS certificate The native root certificates are used to verify the TLS certificate

TODO: allow customizing the TLS configuration

Trait Implementations§

Source§

impl<B> HttpRequest<B> for HttpForwarderService<B>
where B: Body<Data = Bytes, Error = Infallible> + Send + 'static,

Source§

fn send_request<'life0, 'async_trait>( &'life0 mut self, req: Request<B>, ) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send an HTTP request and return the response
Source§

fn ready<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Wait until the connection is ready to send requests

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> GetRaftConfiguration for T
where T: HttpRequest<BoxBody<Bytes, Infallible>> + Send + Sync + 'static,

Source§

fn raft_configuration<'life0, 'async_trait>( &'life0 mut self, token: Secret<String>, ) -> Pin<Box<dyn Future<Output = Result<RaftConfiguration, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Get vault pod’s raft configuration
Source§

fn await_raft_configuration<'life0, 'async_trait>( &'life0 mut self, token: Secret<String>, cond: impl Condition<RaftConfiguration> + Send + 'async_trait, ) -> Pin<Box<dyn Future<Output = Result<Option<RaftConfiguration>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Wait for vault pod’s raft configuration to match the provided condition
Source§

impl<T> GetSealStatus for T
where T: HttpRequest<BoxBody<Bytes, Infallible>> + Send + Sync + 'static,

Source§

fn seal_status<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<PodSealStatus, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Get vault pod’s seal status
Source§

fn await_seal_status<'life0, 'async_trait>( &'life0 mut self, cond: impl Condition<PodSealStatus> + Send + 'async_trait, ) -> Pin<Box<dyn Future<Output = Result<Option<PodSealStatus>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Wait for vault pod’s seal status to match the provided condition
Source§

impl<T> GetUnsealKeys for T
where T: HttpRequest<BoxBody<Bytes, Infallible>> + Send + Sync + 'static,

Source§

fn get_unseal_keys<'life0, 'life1, 'async_trait>( &'life0 mut self, path: &'life1 PathAndQuery, token: Secret<String>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Secret<String>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Get the unseal keys from a Vault secret
Source§

impl<T> Init for T
where T: HttpRequest<BoxBody<Bytes, Infallible>> + Send + Sync + 'static,

Source§

fn init<'life0, 'async_trait>( &'life0 mut self, req: InitRequest, ) -> Pin<Box<dyn Future<Output = Result<InitResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Init a vault process
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> RaftJoin for T
where T: HttpRequest<BoxBody<Bytes, Infallible>> + Send + Sync + 'static,

Source§

fn raft_join<'life0, 'life1, 'async_trait>( &'life0 mut self, join_to: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Join a vault process to a raft cluster
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StepDown for T
where T: HttpRequest<BoxBody<Bytes, Infallible>> + Send + Sync + 'static,

Source§

fn step_down<'life0, 'async_trait>( &'life0 mut self, token: Secret<String>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Step down vault pod from active to standby
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<T> Unseal for T
where T: HttpRequest<BoxBody<Bytes, Infallible>> + Send + Sync + 'static,

Source§

fn unseal<'life0, 'life1, 'async_trait>( &'life0 mut self, keys: &'life1 [Secret<String>], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Unseal a vault process using the provided keys
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