CommentConstructed

Type Alias CommentConstructed 

Source
pub type CommentConstructed<Meta> = Comment<Meta, String>;
Expand description

Base Comment, contains the comment text, if it might have a calculation. Use extract.

Aliased Type§

pub struct CommentConstructed<Meta> {
    pub meta: Meta,
    pub calculation_list: String,
    pub notify: Option<String>,
    pub status: Status,
    pub commands: Commands,
    pub max_length: usize,
}

Fields§

§meta: Meta

Metadata (generic)

§calculation_list: String

Data for the current step

§notify: Option<String>

If Some will prepend a “Hey {string}!” to the reply.

§status: Status§commands: Commands§max_length: usize

How long the reply may at most be

Implementations§

Source§

impl<Meta> CommentConstructed<Meta>

Source

pub fn new( comment_text: &str, meta: Meta, pre_commands: Commands, max_length: usize, ) -> Self

Takes a raw comment, finds the factorials and commands, and packages it, also checks if it might have something to calculate.

Source

pub fn extract(self) -> CommentExtracted<Meta>

Extracts the calculations using parse.

Source

pub fn new_already_replied(meta: Meta, max_length: usize) -> Self

Constructs an empty comment with Status already_replied_or_rejected set.