Struct TrackingSettingsBuilder

Source
pub struct TrackingSettingsBuilder { /* private fields */ }
Expand description

Builder pattern for TrackingSettings. Make sure you call build() to consume this and return the underlying TrackingSetting. Construct with default().

Implementations§

Source§

impl TrackingSettingsBuilder

Source

pub fn click_tracking(self, enable_text: bool) -> Self

Sets the click_tracking setting enabled to be true. Pass true to this method to enable text tracking as well.

§Examples

let builder = TrackingSettingsBuilder::default()
              .click_tracking(true);
Source

pub fn open_tracking(self, substitution_tag: impl Into<String>) -> Self

Sets the open_tracking stting enabled to be true. Pass in the substitution_tag to be replaced with it.

§Examples

let builder = TrackingSettingsBuilder::default()
              .open_tracking("[OPEN_TAG]");
Source

pub fn substitution_tag( self, substitution_tag: impl Into<String>, text: Option<String>, html: Option<String>, ) -> Self

Sets the substitution tag and text and/or html for subscription_tracking

§Parameters

substitution_tag: impl Intl text: Option html: Option

§Examples

let builder = TrackingSettingsBuilder::default()
              .substitution_tag("[SUBSTITUTION_TAG]", None, None);
Source

pub fn build(self) -> TrackingSettings

Consumes the TrackingSettingsBuilder and returns the underlying TrackingSettings

§Examples

let setting = TrackingSettingsBuilder::default().build();

Trait Implementations§

Source§

impl Default for TrackingSettingsBuilder

Source§

fn default() -> TrackingSettingsBuilder

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