host_utils

Struct App

source
pub struct App<'a> { /* private fields */ }

Implementations§

source§

impl<'a> App<'a>

source

pub fn new( parent: &'static str, storage: UserData<'a>, etc_content: Vec<&'a str>, ) -> Result<Self>

source

pub fn get_sources(&self) -> &HashSet<H<'_>>

source

pub fn add_allow(&mut self, args: &'a [&'a str])

source

pub fn add_block(&mut self, args: &'a [&'a str])

source

pub fn add_redirect(&mut self, args: &'a [(&'a str, &'a str)])

source

pub fn add_etc_host<T: IntoIterator<Item = H<'a>>>(&mut self, iter: T)

source

pub fn add_sources(&mut self, args: &'a [&'a str])

source

pub fn rm_allow(&mut self, args: &'a [&'a str])

source

pub fn rm_block(&mut self, args: &'a [&'a str])

source

pub fn rm_redirect(&mut self, args: &'a [&'a str])

source

pub fn rm_sources(&mut self, args: &'a [&'a str])

source

pub fn clear_host(&mut self)

source

pub fn export_allow<T: AsRef<Path>>(&mut self, path: T)

source

pub fn export_block<T: AsRef<Path>>(&mut self, path: T)

source

pub fn export_redirect<T: AsRef<Path>>(&mut self, path: T)

source

pub fn export_sources<T: AsRef<Path>>(&mut self, path: T)

source

pub fn restore_etc_host_file<P: AsRef<Path>>(path: P) -> Result<()>

source

pub fn save(&mut self)

Auto Trait Implementations§

§

impl<'a> Freeze for App<'a>

§

impl<'a> RefUnwindSafe for App<'a>

§

impl<'a> Send for App<'a>

§

impl<'a> Sync for App<'a>

§

impl<'a> Unpin for App<'a>

§

impl<'a> UnwindSafe for App<'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.