Configuration

Struct Configuration 

Source
pub struct Configuration {
Show 13 fields pub filter_list_type: FilterListType, pub working_directory: Option<String>, pub locale: Locale, pub default_filter_list_expires_period_sec: i32, pub filters_compilation_policy: FiltersCompilationPolicy, pub metadata_url: String, pub metadata_locales_url: String, pub request_timeout_ms: i32, pub request_proxy_mode: RequestProxyMode, pub should_ignore_expires_for_local_urls: bool, pub auto_lift_up_database: bool, pub app_name: String, pub version: String,
}
Expand description

Configuration object

Fields§

§filter_list_type: FilterListType

Type of filter lists to manage

§working_directory: Option<String>

Absolute path for library working directory. This will be used for database operating. if value is None cwd will be used

§locale: Locale

Locale is the locale that needs to be used to extract localized names and descriptions. Locale en-GB will be normalized to internal en_GB representation. Default value: en

§default_filter_list_expires_period_sec: i32

Default period for expires in seconds (unless specified in “Expires”, or its value is too small). Default value: 86400 Values < 3600 will be clamped to 3600 There is one exception for local filters: If should_ignore_expires_for_local_urls is set to true, then expires will be ignored for local filters.

§filters_compilation_policy: FiltersCompilationPolicy

Settings for filters compilation or collection from compiled parts.

§Compilation

During the update, each filter will be “compiled” into main filter and its includes. Main filter remains unchanged. But in includes, (include, if/else/endif) directives will be resolved, using this policy. Recursive includes will be inlined.

§Collection

When you get filters, they will be collected from compiled parts (main filter + includes). All directives in main filter will be resolved, using this policy, and includes will be injected.

§metadata_url: String

URL of the index (filters.json) file

§metadata_locales_url: String

URL of the locales (filters_i18n.json) file

§request_timeout_ms: i32

Requests timeouts in milliseconds. Default value 60000

§request_proxy_mode: RequestProxyMode

Requests proxy mode

§should_ignore_expires_for_local_urls: bool

Should ignore expires for local urls during update This may be useful for local filters update. Default value: false

§auto_lift_up_database: bool

“Uplifting” a database is a set of measures that brings the database up to date:

  • Database creation
  • Filling with schema
  • Creation of service tables and entities
  • Migrating between versions of a given library

If you want to disable this option, you will need to manually call flm.lift_up_database() when you update the library in your application. Default value: true

§app_name: String

Client app name

§version: String

Client app version

Trait Implementations§

Source§

impl Default for Configuration

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,