Skip to main content

EditMessage

Struct EditMessage 

Source
pub struct EditMessage { /* private fields */ }
Expand description

An edit of one of this member’s messages. A plain &str replaces the text and leaves the embeds and mentions as they are.

An edit uploads nothing: an embed’s pictures must be attachments the message already has (Picture::Attachment, or an Attachment of it).

Implementations§

Source§

impl EditMessage

Source

pub fn mention_member(self, member: MemberId) -> Self

Notifies member, as MessageOptions::mention_member. Any mention on an edit replaces all of the message’s mentions, and needs SEND_MESSAGES.

Source

pub fn mention_role(self, role: RoleId) -> Self

Notifies the members with role, as MessageOptions::mention_role.

Source

pub fn mention_everyone(self) -> Self

Notifies everyone who can see the channel (needs MENTION_EVERYONE; dropped without).

Source

pub fn mentions(self, mentions: Mentions) -> Self

Replaces the message’s mentions with exactly mentions; Mentions::default clears them, @everyone too.

Source

pub const fn mentions_from_content(self) -> Self

Also notifies whoever the text shows (see mention::parse): the new text, or the message’s own when the edit keeps it. The edit then always sends mentions, so text that shows none clears them. Only for text this member wrote.

Source§

impl EditMessage

Source

pub fn new() -> Self

An edit that changes nothing yet: the text stays (a Message knows it; a PartialMessage needs content), and so do the embeds.

Source

pub fn content(self, content: impl Into<String>) -> Self

The new text.

Source

pub fn embed(self, embed: impl Into<EmbedBuilder>) -> Self

Replaces the embeds with these, starting with this one.

Source

pub fn embeds( self, embeds: impl IntoIterator<Item = impl Into<EmbedBuilder>>, ) -> Self

Replaces the embeds with embeds (none removes them all).

Source

pub fn clear_embeds(self) -> Self

Removes every embed.

Trait Implementations§

Source§

impl Clone for EditMessage

Source§

fn clone(&self) -> EditMessage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for EditMessage

Source§

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

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

impl Default for EditMessage

Source§

fn default() -> EditMessage

Returns the “default value” for a type. Read more
Source§

impl Eq for EditMessage

Source§

impl From<&String> for EditMessage

Source§

fn from(content: &String) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for EditMessage

Source§

fn from(content: &str) -> Self

Converts to this type from the input type.
Source§

impl From<EmbedBuilder> for EditMessage

Source§

fn from(embed: EmbedBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<String> for EditMessage

Source§

fn from(content: String) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EditMessage

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EditMessage

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> CryptoSafe for T
where T: Send + Sync + Debug,

§

impl<T> CryptoSafe for T

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more