frontmatter_gen::config

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() -> Builder

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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T