[][src]Struct mdcat::Environment

pub struct Environment {
    pub base_url: Url,
    pub hostname: String,
}

The environment to render markdown in.

Fields

base_url: Url

The base URL to resolve relative URLs with.

hostname: String

The local host name.

Implementations

impl Environment[src]

pub fn for_localhost(base_url: Url) -> Result<Self>[src]

Create an environment for the local host with the given base_url.

Take the local hostname from gethostname.

pub fn for_local_directory<P: AsRef<Path>>(base_dir: &P) -> Result<Self>[src]

Create an environment for a local diretory.

Convert the directory to a directory URL, and obtain the hostname from gethostname.

base_dir must be an absolute path; return an IO error with ErrorKind::InvalidInput otherwise.

Trait Implementations

impl Debug for Environment[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.