[][src]Struct https_everywhere_lib_core::Updater

pub struct Updater<'a> { /* fields omitted */ }

Methods

impl<'a> Updater<'a>[src]

pub fn new(
    rulesets: &'a mut RuleSets,
    update_channels: &'a UpdateChannels,
    storage: &'a dyn Storage,
    default_rulesets: Option<String>,
    periodicity: usize
) -> Updater<'a>
[src]

Returns an updater with the rulesets, update channels, storage, and interval to check for new rulesets

Arguments

  • rulesets - A ruleset struct to update
  • update_channels - The update channels where to look for new rulesets
  • storage - The storage engine for key-value pairs
  • default_rulesets - An optional string representing the default rulesets, which may or may not be replaced by updates
  • periodicity - The interval to check for new rulesets

pub fn perform_check(&mut self)[src]

Perform a check for updates. For all ruleset update channels:

  1. Check if new rulesets exist by requesting a defined endpoint for a timestamp, which is compared to a stored timestamp
  2. If new rulesets exist, download them along with a signature
  3. Verify if the signature is valid, and if so...
  4. Store the rulesets

pub fn apply_stored_rulesets(&mut self)[src]

Modify rulesets struct to apply the stored rulesets

pub fn time_to_next_check(&self) -> usize[src]

Return the time until we should check for new rulesets, in seconds

pub fn clear_replacement_update_channels(&self)[src]

Clear the stored rulesets for any update channels which replace the default rulesets. This should be run when a new version of the extension is released, so the bundled rulesets are not overwritten by old stored rulesets.

Auto Trait Implementations

impl<'a> Unpin for Updater<'a>

impl<'a> !Sync for Updater<'a>

impl<'a> !Send for Updater<'a>

impl<'a> !UnwindSafe for Updater<'a>

impl<'a> !RefUnwindSafe for Updater<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]