Struct futhorc::tag::Tag

source · []
pub struct Tag {
    pub name: String,
    pub url: UrlBuf,
}
Expand description

Represents a crate::post::Post tag. On parsing a post from YAML, only the name field is parsed while the url field is left empty. The URL field must be filled in later based on the index_base_url and the tag name.

Fields

name: String

The tag’s name. This should be slugified so e.g., macOS and MacOS resolve to the same value, and also so the field can be dropped into a crate::url::UrlBuf.

url: UrlBuf

The URL for the tag’s first index page. Given an index_base_url, this should look something like {index_base_url}/{tag_name}/index.html.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Implements serde::de::Deserialize for Tag. This expects a string and will deserialize it into a Tag whose name is the sluggified input string and whose url field is left empty.

Converts Tags into Values for templating.

Implements Hash for Tag by delegating directly to the name field.

Feeds a slice of this type into the given Hasher. Read more

Implements PartialEq and Eq for Tag by delegating directly to the name field.

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.