Skip to main content

Builder

Struct Builder 

Source
pub struct Builder { /* private fields */ }
Expand description

Builder for creating Config instances

Implementations§

Source§

impl Builder

Source

pub fn site_name<S: Into<String>>(self, name: S) -> Self

Sets the site name

Source

pub fn site_title<S: Into<String>>(self, title: S) -> Self

Sets the site title

Source

pub fn site_description<S: Into<String>>(self, desc: S) -> Self

Sets the site description

Source

pub fn language<S: Into<String>>(self, lang: S) -> Self

Sets the language code

Source

pub fn base_url<S: Into<String>>(self, url: S) -> Self

Sets the base URL

Source

pub fn content_dir<P: Into<PathBuf>>(self, path: P) -> Self

Sets the content directory

Source

pub fn output_dir<P: Into<PathBuf>>(self, path: P) -> Self

Sets the output directory

Source

pub fn template_dir<P: Into<PathBuf>>(self, path: P) -> Self

Sets the template directory

Source

pub fn serve_dir<P: Into<PathBuf>>(self, path: P) -> Self

Sets the serve directory

Source

pub const fn server_enabled(self, enabled: bool) -> Self

Enables or disables the development server

Source

pub const fn server_port(self, port: u16) -> Self

Sets the server port

Source

pub fn build(self) -> Result<Config>

Builds the Config instance

§Returns

Returns a Result containing the built Config or an error

§Errors

Will return an error if:

  • Required fields are missing
  • Validation fails

Trait Implementations§

Source§

impl Debug for Builder

Source§

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

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

impl Default for Builder

Source§

fn default() -> Self

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

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.