Section

Enum Section 

Source
pub enum Section {
    BlankLine,
    Comment(String),
    Global {
        comment: Option<String>,
        lines: Vec<Line>,
    },
    Default {
        comment: Option<String>,
        proxy: Option<String>,
        lines: Vec<Line>,
    },
    Frontend {
        comment: Option<String>,
        proxy: String,
        lines: Vec<Line>,
        header_addr: Option<(Address, Option<String>)>,
    },
    Listen {
        comment: Option<String>,
        proxy: String,
        lines: Vec<Line>,
        header_addr: Option<(Address, Option<String>)>,
    },
    Backend {
        comment: Option<String>,
        proxy: String,
        lines: Vec<Line>,
    },
    Userlist {
        comment: Option<String>,
        name: String,
        lines: Vec<Line>,
    },
    UnknownLine {
        line: String,
    },
}
Expand description

Represents a section in a config file.

Variants§

§

BlankLine

§

Comment(String)

Comment on a separate line not in a section

§

Global

The global section of a config.

Fields

§comment: Option<String>

Comment on the same line as the section header

§lines: Vec<Line>

Lines in this section.

§

Default

The lines in the default section of a config.

Fields

§comment: Option<String>

Comment on the same line as the section header

§proxy: Option<String>

The default proxy stated after the section header

§lines: Vec<Line>

Lines in this section.

§

Frontend

Fields

§comment: Option<String>

Comment on the same line as the section header

§proxy: String

The proxy stated after the section header

§lines: Vec<Line>

Lines in this section.

§header_addr: Option<(Address, Option<String>)>

Optional address to which the frontend binds can be stated in the header, for example frontend webserver *:80 instead of a bind line, any optional config for the bind follows

§

Listen

Fields

§comment: Option<String>

Comment on the same line as the section header

§proxy: String

The proxy stated after the section header

§lines: Vec<Line>

Lines in this section.

§header_addr: Option<(Address, Option<String>)>

Optional address to which the listen binds can be stated in the header, for example frontend webserver *:80 instead of a bind line, any optional config for the bind follows

§

Backend

Fields

§comment: Option<String>

Comment on the same line as the section header

§proxy: String

The proxy stated after the section header

§lines: Vec<Line>

Lines in this section.

§

Userlist

Fields

§comment: Option<String>

Comment on the same line as the section header

§name: String

Name of this userlist

§lines: Vec<Line>

Lines in this section.

§

UnknownLine

Fields

§line: String

A line that could not be parsed.

Trait Implementations§

Source§

impl Debug for Section

Source§

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

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

impl<'a> From<&'a Section<'a>> for Section

Source§

fn from(section: &'a Section<'a>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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.