Struct db_adapter::slap::SlapReport [−][src]
pub struct SlapReport {
pub sentence: MessageId,
pub offender: UserId,
pub enforcer: Enforcer,
pub reason: Option<String>,
}
Expand description
A single slap object
Fields
sentence: MessageId
Message from which the slap originates
Depending on enforcer
, sentence
has a different meaning. If it is Enforcer::Community
, then sentence
points to the message attributed to the reason of the slap. That is to say the one users collectively reacted
with the slap emoji.
Otherwise it points to the message that issued the slap (so a command message).
offender: UserId
The slapped user.
enforcer: Enforcer
Who delivered the slap.
See Enforcer
for more information.
reason: Option<String>
The reason for the slap.
This is None
if enforcer
is Enforcer::Community
or if the default reason was used.
The default reason is used when the enforcer doesn’t provide a reason
argument when issueing the slap.
Implementations
pub async fn get<'a, PgExec: Executor<'a, Database = Postgres>>(
conn: PgExec,
sentence: MessageId
) -> Result<Option<SlapReport>, AdapterError>
pub async fn get<'a, PgExec: Executor<'a, Database = Postgres>>(
conn: PgExec,
sentence: MessageId
) -> Result<Option<SlapReport>, AdapterError>
Retrieves a SlapReport
Returns None
if no such slap exists.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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
impl RefUnwindSafe for SlapReport
impl Send for SlapReport
impl Sync for SlapReport
impl Unpin for SlapReport
impl UnwindSafe for SlapReport
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more