Struct App

Source
pub struct App<'a, O: Write, E: Write> { /* private fields */ }

Implementations§

Source§

impl<'a, O: Write, E: Write> App<'a, O, E>

Source

pub fn new<R: Read>( etc_hosts: &'a str, db: Option<R>, stdout: &'a mut O, stderr: &'a mut E, ) -> Result<Self>

Source

pub fn get_sources(&self) -> &HashMap<Cow<'a, str>, [u8; 32]>

Source

pub fn add_allow<T: Iterator<Item = &'a str>>(&mut self, args: T)

Source

pub fn rm_allow<T: Iterator<Item = &'a str>>(&mut self, args: T)

Source

pub fn add_block<T: Iterator<Item = &'a str>>(&mut self, args: T)

Source

pub fn rm_block<T: Iterator<Item = &'a str>>(&mut self, args: T)

Source

pub fn add_redirect<T: Iterator<Item = (&'a str, &'a str)>>(&mut self, args: T)

Source

pub fn rm_redirect<T: Iterator<Item = &'a str>>(&mut self, args: T)

Source

pub fn add_sources<T: Iterator<Item = &'a str>>(&mut self, args: T)

Source

pub fn rm_sources<T: Iterator<Item = &'a str>>(&mut self, args: T)

Source

pub fn get_update(&mut self) -> Vec<(String, String, [u8; 32])>

Source

pub fn print_etc_hosts(&mut self) -> Result<()>

Source

pub fn get_update_fource(&mut self) -> Vec<(String, String, [u8; 32])>

Source

pub fn apply_update(&mut self, update: &'a [(String, String, [u8; 32])])

Source

pub fn clear_host(&mut self)

Source

pub fn export<W: Write>(&mut self, w: &mut W) -> Result<()>

Source

pub fn save_1<W1: Write, W2: Write>( &mut self, w1: &mut W1, w2: &mut W2, ) -> Result<()>

Source

pub fn save<W1: Write, W2: Write, F: FnOnce() -> (W1, W2)>( &mut self, f: F, ) -> Result<()>

Source

pub fn restore_etc_hosts<W: Write>(etc_hosts: &str, w: &mut W) -> Result<()>

Source

pub fn clear_data(&mut self)

Source

pub fn restore_data<W: Write>(w: &mut W) -> Result<()>

Auto Trait Implementations§

§

impl<'a, O, E> Freeze for App<'a, O, E>

§

impl<'a, O, E> RefUnwindSafe for App<'a, O, E>

§

impl<'a, O, E> Send for App<'a, O, E>
where O: Send, E: Send,

§

impl<'a, O, E> Sync for App<'a, O, E>
where O: Sync, E: Sync,

§

impl<'a, O, E> Unpin for App<'a, O, E>

§

impl<'a, O, E> !UnwindSafe for App<'a, O, E>

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> 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.