traq_bot_http

Enum Event

Source
#[non_exhaustive]
pub enum Event {
Show 24 variants Ping(PingPayload), Joined(JoinedPayload), Left(LeftPayload), MessageCreated(MessageCreatedPayload), MessageDeleted(MessageDeletedPayload), MessageUpdated(MessageUpdatedPayload), DirectMessageCreated(DirectMessageCreatedPayload), DirectMessageDeleted(DirectMessageDeletedPayload), DirectMessageUpdated(DirectMessageUpdatedPayload), BotMessageStampsUpdated(BotMessageStampsUpdatedPayload), ChannelCreated(ChannelCreatedPayload), ChannelTopicChanged(ChannelTopicChangedPayload), UserCreated(UserCreatedPayload), StampCreated(StampCreatedPayload), TagAdded(TagAddedPayload), TagRemoved(TagRemovedPayload), UserGroupCreated(UserGroupCreatedPayload), UserGroupUpdated(UserGroupUpdatedPayload), UserGroupDeleted(UserGroupDeletedPayload), UserGroupMemberAdded(UserGroupMemberAddedPayload), UserGroupMemberUpdated(UserGroupMemberUpdatedPayload), UserGroupMemberRemoved(UserGroupMemberRemovedPayload), UserGroupAdminAdded(UserGroupAdminAddedPayload), UserGroupAdminRemoved(UserGroupAdminRemovedPayload),
}
Expand description

イベント全てを網羅するenum (non-exhaustive)

§Example

use traq_bot_http::Event;
use traq_bot_http::payloads::PingPayload;
let payload = r#"{
    "eventTime": "2019-05-07T04:50:48.582586882Z"
}"#;
let payload = serde_json::from_str::<PingPayload>(payload)?;
let event = Event::Ping(payload);

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Ping(PingPayload)

ボットの接続確認

§

Joined(JoinedPayload)

チャンネルに参加した

§

Left(LeftPayload)

チャンネルから退出した

§

MessageCreated(MessageCreatedPayload)

メッセージが作成された

§

MessageDeleted(MessageDeletedPayload)

メッセージが削除された

§

MessageUpdated(MessageUpdatedPayload)

メッセージが更新された

§

DirectMessageCreated(DirectMessageCreatedPayload)

ダイレクトメッセージが作成された

§

DirectMessageDeleted(DirectMessageDeletedPayload)

ダイレクトメッセージが削除された

§

DirectMessageUpdated(DirectMessageUpdatedPayload)

ダイレクトメッセージが更新された

§

BotMessageStampsUpdated(BotMessageStampsUpdatedPayload)

ボットのメッセージにスタンプが付けられた

§

ChannelCreated(ChannelCreatedPayload)

チャンネルが作成された

§

ChannelTopicChanged(ChannelTopicChangedPayload)

チャンネルのトピックが変更された

§

UserCreated(UserCreatedPayload)

ユーザーが作成された

§

StampCreated(StampCreatedPayload)

スタンプが作成された

§

TagAdded(TagAddedPayload)

BOTにタグが追加された

§

TagRemoved(TagRemovedPayload)

BOTからタグが削除された

§

UserGroupCreated(UserGroupCreatedPayload)

ユーザーグループが作成された

§

UserGroupUpdated(UserGroupUpdatedPayload)

ユーザーグループが更新された

§

UserGroupDeleted(UserGroupDeletedPayload)

ユーザーグループが削除された

§

UserGroupMemberAdded(UserGroupMemberAddedPayload)

ユーザーグループにメンバーが追加された

§

UserGroupMemberUpdated(UserGroupMemberUpdatedPayload)

ユーザーグループのメンバーが更新された

§

UserGroupMemberRemoved(UserGroupMemberRemovedPayload)

ユーザーグループからメンバーが削除された

§

UserGroupAdminAdded(UserGroupAdminAddedPayload)

ユーザーグループに管理者が追加された

§

UserGroupAdminRemoved(UserGroupAdminRemovedPayload)

ユーザーグループから管理者が削除された

Implementations§

Source§

impl Event

Source

pub fn kind(&self) -> EventKind

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<BotMessageStampsUpdatedPayload> for Event

Source§

fn from(event: BotMessageStampsUpdatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<ChannelCreatedPayload> for Event

Source§

fn from(event: ChannelCreatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<ChannelTopicChangedPayload> for Event

Source§

fn from(event: ChannelTopicChangedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<DirectMessageCreatedPayload> for Event

Source§

fn from(event: DirectMessageCreatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<DirectMessageDeletedPayload> for Event

Source§

fn from(event: DirectMessageDeletedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<DirectMessageUpdatedPayload> for Event

Source§

fn from(event: DirectMessageUpdatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<JoinedPayload> for Event

Source§

fn from(event: JoinedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<LeftPayload> for Event

Source§

fn from(event: LeftPayload) -> Self

Converts to this type from the input type.
Source§

impl From<MessageCreatedPayload> for Event

Source§

fn from(event: MessageCreatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<MessageDeletedPayload> for Event

Source§

fn from(event: MessageDeletedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<MessageUpdatedPayload> for Event

Source§

fn from(event: MessageUpdatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<PingPayload> for Event

Source§

fn from(event: PingPayload) -> Self

Converts to this type from the input type.
Source§

impl From<StampCreatedPayload> for Event

Source§

fn from(event: StampCreatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<TagAddedPayload> for Event

Source§

fn from(event: TagAddedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<TagRemovedPayload> for Event

Source§

fn from(event: TagRemovedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserCreatedPayload> for Event

Source§

fn from(event: UserCreatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserGroupAdminAddedPayload> for Event

Source§

fn from(event: UserGroupAdminAddedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserGroupAdminRemovedPayload> for Event

Source§

fn from(event: UserGroupAdminRemovedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserGroupCreatedPayload> for Event

Source§

fn from(event: UserGroupCreatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserGroupDeletedPayload> for Event

Source§

fn from(event: UserGroupDeletedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserGroupMemberAddedPayload> for Event

Source§

fn from(event: UserGroupMemberAddedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserGroupMemberRemovedPayload> for Event

Source§

fn from(event: UserGroupMemberRemovedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserGroupMemberUpdatedPayload> for Event

Source§

fn from(event: UserGroupMemberUpdatedPayload) -> Self

Converts to this type from the input type.
Source§

impl From<UserGroupUpdatedPayload> for Event

Source§

fn from(event: UserGroupUpdatedPayload) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Event) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Event

Source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.