Struct Options

Source
pub struct Options<'a> {
    pub application_id: &'a str,
    pub api_key: &'a str,
    pub database_url: Option<&'a str>,
    pub ga_tracking_id: Option<&'a str>,
    pub storage_bucket: Option<&'a str>,
    pub project_id: Option<&'a str>,
    pub gcm_sender_id: Option<&'a str>,
    pub auth_domain: Option<&'a str>,
}
Expand description

Represents the configurable options for an application.

Fields§

§application_id: &'a str

The application ID.

§api_key: &'a str

The API key for accessing the application.

§database_url: Option<&'a str>

The URL of the database (optional).

§ga_tracking_id: Option<&'a str>

The Google Analytics tracking ID (optional).

§storage_bucket: Option<&'a str>

The storage bucket (optional).

§project_id: Option<&'a str>

The project ID (optional).

§gcm_sender_id: Option<&'a str>

The Google Cloud Messaging (GCM) sender ID (optional).

§auth_domain: Option<&'a str>

The authentication domain (optional).

Implementations§

Source§

impl<'a> Options<'a>

Source

pub const fn new(application_id: &'a str, api_key: &'a str) -> Self

Creates a new instance of the Options struct.

§Arguments
  • application_id - The application ID.
  • api_key - The API key for accessing the application.
§Returns

A new Options instance.

Source

pub const fn with_database_url(self, database_url: &'a str) -> Self

Sets the database URL for the options.

§Arguments
  • database_url - The URL of the database.
§Returns

The modified Options instance.

Source

pub const fn with_ga_tracking_id(self, ga_tracking_id: &'a str) -> Self

Sets the Google Analytics tracking ID for the options.

§Arguments
  • ga_tracking_id - The Google Analytics tracking ID.
§Returns

The modified Options instance.

Source

pub const fn with_storage_bucket(self, storage_bucket: &'a str) -> Self

Sets the storage bucket for the options.

§Arguments
  • storage_bucket - The storage bucket.
§Returns

The modified Options instance.

Source

pub const fn with_project_id(self, project_id: &'a str) -> Self

Sets the project ID for the options.

§Arguments
  • project_id - The project ID.
§Returns

The modified Options instance.

Source

pub const fn with_gcm_sender_id(self, gcm_sender_id: &'a str) -> Self

Sets the Google Cloud Messaging (GCM) sender ID for the options.

§Arguments
  • gcm_sender_id - The GCM sender ID.
§Returns

The modified Options instance.

Source

pub const fn with_auth_domain(self, auth_domain: &'a str) -> Self

Sets the authentication domain for the options.

§Arguments
  • auth_domain - The authentication domain.
§Returns

The modified Options instance.

Auto Trait Implementations§

§

impl<'a> Freeze for Options<'a>

§

impl<'a> RefUnwindSafe for Options<'a>

§

impl<'a> Send for Options<'a>

§

impl<'a> Sync for Options<'a>

§

impl<'a> Unpin for Options<'a>

§

impl<'a> UnwindSafe for Options<'a>

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.