pub struct ServiceEndpointsBuilder { /* private fields */ }
Expand description

Used for configuring the SDKs service URLs.

The default behavior, if you do not change any of these properties, is that the SDK will connect to the standard endpoints in the LaunchDarkly production service. There are several use cases for changing these properties:

§Examples

Configure for a Relay Proxy instance.

    ConfigBuilder::new("sdk-key").service_endpoints(ServiceEndpointsBuilder::new()
        .relay_proxy("http://my-relay-hostname:8080"));

Configure for a private LaunchDarkly instance.

   ConfigBuilder::new("sdk-key").service_endpoints(ServiceEndpointsBuilder::new()
        .polling_base_url("https://sdk.my-private-instance.com")
        .streaming_base_url("https://stream.my-private-instance.com")
        .events_base_url("https://events.my-private-instance.com"));

Implementations§

source§

impl ServiceEndpointsBuilder

source

pub fn new() -> ServiceEndpointsBuilder

Create a new instance of ServiceEndpointsBuilder with no URLs specified.

source

pub fn polling_base_url(&mut self, url: &str) -> &mut Self

Sets a custom base URL for the polling service.

source

pub fn streaming_base_url(&mut self, url: &str) -> &mut Self

Sets a custom base URL for the streaming service.

source

pub fn events_base_url(&mut self, url: &str) -> &mut Self

Sets a custom base URI for the events service.

source

pub fn relay_proxy(&mut self, url: &str) -> &mut Self

Specifies a single base URL for a Relay Proxy instance.

source

pub fn build(&self) -> Result<ServiceEndpoints, BuildError>

Called internally by the SDK to create a configuration instance. Applications do not need to call this method.

§Errors

When using custom endpoints it is important that all of the URLs are set. If some URLs are set, but others are not, then this will return an error. If no URLs are set, then the default values will be used. This prevents a combination of custom and default values from being used.

Trait Implementations§

source§

impl Clone for ServiceEndpointsBuilder

source§

fn clone(&self) -> ServiceEndpointsBuilder

Returns a copy 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 Default for ServiceEndpointsBuilder

source§

fn default() -> Self

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

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> 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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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