Enum tdtxt::prelude::Component[][src]

pub enum Component<'a> {
    Text(&'a str),
    Project(&'a str),
    Context(&'a str),
    Custom {
        key: &'a str,
        separator: &'a str,
        value: &'a str,
    },
}
Expand description

A single component of a Description.

Variants of this enum are created by Components, which is an iterator over all components of a description. This iterator is returned by calling Description::components.

Variants

Text(&'a str)

A text component, e.g. Hello World.

Tuple Fields of Text

0: &'a str
Project(&'a str)

A full project component, e.g. +project.

Tuple Fields of Project

0: &'a str
Context(&'a str)

A full context component, e.g. @context.

Tuple Fields of Context

0: &'a str
Custom

A full custom tag component, e.g. key:value.

Fields of Custom

key: &'a str

The key of the tag, e.g. key.

separator: &'a str

The separator of the tag (this should always be :).

value: &'a str

The value of the tag, e.g. value.

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

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

Performs the conversion.

Performs the conversion.

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)

recently added

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.