Struct schema_registry_converter::async_impl::schema_registry::SrSettingsBuilder [−][src]
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]
&mut self,
username: &str,
password: Option<&str>
) -> &mut SrSettingsBuilder
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
impl RefUnwindSafe for SrSettingsBuilder
[src]
impl Send for SrSettingsBuilder
[src]
impl Sync for SrSettingsBuilder
[src]
impl Unpin for SrSettingsBuilder
[src]
impl UnwindSafe for SrSettingsBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> GetTypeId for T where
T: Any,
[src]
T: Any,
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,