Skip to main content

stoat/ext/
interactions.rs

1use indexmap::IndexSet;
2use stoat_models::v0::Interactions;
3
4pub trait InteractionsExt {
5    fn reactions<I: Into<IndexSet<String>>>(self, reactions: I) -> Self;
6    fn restrict_reactions(self, restrict_reactions: bool) -> Self;
7}
8
9impl InteractionsExt for Interactions {
10    fn reactions<I: Into<IndexSet<String>>>(mut self, reactions: I) -> Self {
11        self.reactions = Some(reactions.into());
12        self
13    }
14
15    fn restrict_reactions(mut self, restrict_reactions: bool) -> Self {
16        self.restrict_reactions = restrict_reactions;
17        self
18    }
19}