Struct schema_registry_converter::async_impl::schema_registry::SrSettingsBuilder[][src]

pub struct SrSettingsBuilder { /* fields omitted */ }

Struct to create an SrSettings when used with multiple url's, authorization, custom headers, or custom timeout.

Implementations

impl SrSettingsBuilder[src]

Builder for SrSettings

use schema_registry_converter::async_impl::schema_registry::{SrSettings};
use std::time::Duration;
let sr_settings = SrSettings::new_builder(String::from("http://localhost:8081"))
    .add_url(String::from("http://localhost:8082"))
    .set_token_authorization("some_json_web_token_for_example")
    .add_header("foo", "bar")
    .set_proxy("http://localhost:8888")
    .set_timeout(Duration::from_secs(5))
    .build().unwrap();

pub fn add_url(&mut self, url: String) -> &mut SrSettingsBuilder[src]

Adds an url. For any call urls will be tried in order. the one used to create the settings struct first. All urls should be fully qualified.

pub fn set_token_authorization(&mut self, token: &str) -> &mut SrSettingsBuilder[src]

Sets the token that needs to be used to authenticate

pub fn set_basic_authorization(
    &mut self,
    username: &str,
    password: Option<&str>
) -> &mut SrSettingsBuilder
[src]

Sets basic authentication, for confluent cloud, the username is the API Key and the password is the API Secret.

pub fn add_header(&mut self, key: &str, value: &str) -> &mut SrSettingsBuilder[src]

Adds a custom header that will be added to every call.

pub fn set_proxy(&mut self, proxy_url: &str) -> &mut SrSettingsBuilder[src]

Sets a proxy that will be used for every call.

pub fn set_timeout(&mut self, duration: Duration) -> &mut SrSettingsBuilder[src]

Set a timeout, it will be used for the connect and the read.

pub fn build(&mut self) -> Result<SrSettings, SRCError>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> GetTypeId for T where
    T: Any
[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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