[−][src]Struct https_everywhere_lib_core::Updater
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]
rulesets: &'a mut RuleSets,
update_channels: &'a UpdateChannels,
storage: &'a dyn Storage,
default_rulesets: Option<String>,
periodicity: usize
) -> Updater<'a>
Returns an updater with the rulesets, update channels, storage, and interval to check for new rulesets
Arguments
rulesets
- A ruleset struct to updateupdate_channels
- The update channels where to look for new rulesetsstorage
- The storage engine for key-value pairsdefault_rulesets
- An optional string representing the default rulesets, which may or may not be replaced by updatesperiodicity
- The interval to check for new rulesets
pub fn perform_check(&mut self)
[src]
Perform a check for updates. For all ruleset update channels:
- Check if new rulesets exist by requesting a defined endpoint for a timestamp, which is compared to a stored timestamp
- If new rulesets exist, download them along with a signature
- Verify if the signature is valid, and if so...
- 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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,