Struct alog::Config

source ·
pub struct Config<'a> {
    pub ipv4: &'a str,
    pub ipv6: &'a str,
    pub host: &'a str,
    pub skip: bool,
    pub authuser: bool,
    pub trim: bool,
    pub optimize: bool,
    pub flush: bool,
}
Expand description

Collection of replacement strings / config flags

Fields§

§ipv4: &'a str

IPv4-parseable $remote_addr replacement string

§ipv6: &'a str

IPv6-parseable $remote_addr replacement string

§host: &'a str

$remote_addr replacement string

§skip: bool

Skip lines w/o a $remote_addr part / first word

§authuser: bool

Try to clear the authuser field

§trim: bool

Trim spaces from the start of every line

§optimize: bool

Don’t clear authuser fields starting with “- [” We assume these fields are already cleared.

§flush: bool

Flush output after each line

Implementations§

source§

impl<'a> Config<'a>

source

pub fn new() -> Self

source

pub fn get_ipv4_value(&self) -> &'a str

Get IPv4 replacement value

source

pub fn get_ipv6_value(&self) -> &'a str

Get IPv6 replacement value

source

pub fn get_host_value(&self) -> &'a str

Get string replacement value

source

pub fn get_skip(&self) -> bool

Get skip value

source

pub fn get_authuser(&self) -> bool

Get authuser value

source

pub fn get_trim(&self) -> bool

Get trim value

source

pub fn get_optimize(&self) -> bool

Get optimize value

source

pub fn get_flush(&self) -> bool

Get flush value

source

pub fn set_ipv4_value(&mut self, ipv4: &'a str)

Set IPv4 replacement String

source

pub fn set_ipv6_value(&mut self, ipv6: &'a str)

Set IPv6 replacement String

source

pub fn set_host_value(&mut self, host: &'a str)

Set hostname replacement String

source

pub fn set_flush(&mut self, b: bool)

Set flush field

source

pub fn set_authuser(&mut self, b: bool)

Set authuser field

source

pub fn set_trim(&mut self, b: bool)

Set trim field

source

pub fn set_optimize(&mut self, b: bool)

Set optimize field

source

pub fn set_skip(&mut self, b: bool)

Set skip field

Trait Implementations§

source§

impl<'a> Debug for Config<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for Config<'a>

$remote_addr replacements default to an equivalent of localhost

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Config<'a>

§

impl<'a> Send for Config<'a>

§

impl<'a> Sync for Config<'a>

§

impl<'a> Unpin for Config<'a>

§

impl<'a> UnwindSafe for Config<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.