Struct vaas::builder::Builder

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

Builder struct to create a new Vaas instance with the expected default values.

// Create a new [Vaas] instance from the builder.
use vaas::Builder;
use vaas::auth::authenticators::ClientCredentials;

let authenticator = ClientCredentials::new("client_id".to_string(), "client_secret".to_string());

let vaas = Builder::new(authenticator).build()?;

Implementations§

source§

impl<A: Authenticator> Builder<A>

source

pub fn new(authenticator: A) -> Self

Create a new VaasBuilder to create a Vaas instance.

source

pub fn keep_alive_delay_ms(self, delay: u64) -> Self

Set the delay in which a Ping is sent to the server to keep the connection alive. Defaults to 10s.

source

pub fn keep_alive(self, keep_alive: bool) -> Self

Enable or disable periodic pings to the server to keep the connection alive. Defaults to enabled (true).

source

pub fn use_cache(self, use_cache: bool) -> Self

Enable or disable the Cache-Lookup on the server

source

pub fn use_hash_lookup(self, use_hash_lookup: bool) -> Self

Enable or disable the Hash-Lookup on the server

source

pub fn channel_capacity(self, capacity: usize) -> Self

Set the channel capacity of the internal results channel. Increase the value if a ResultChannelError("channel lagged by X") is received. Defaults to 100.

source

pub fn url(self, url: Url) -> Self

Change the URL of the VaaS API.

source

pub fn build(self) -> VResult<Vaas<A>>

Create a Vaas struct from the VaasBuilder.

Auto Trait Implementations§

§

impl<A> Freeze for Builder<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for Builder<A>
where A: RefUnwindSafe,

§

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

§

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

§

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

§

impl<A> UnwindSafe for Builder<A>
where A: 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> 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

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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<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