pub struct EmbedOptions {
pub callbacks: Vec<CallbackSignature>,
pub errbacks: Vec<CallbackSignature>,
pub chain: Vec<CallbackSignature>,
pub chord: Option<CallbackSignature>,
pub group: Option<Uuid>,
pub parent_id: Option<Uuid>,
pub root_id: Option<Uuid>,
pub extra: HashMap<String, Value>,
}Expand description
Embed options in the message body
Fields§
§callbacks: Vec<CallbackSignature>Callbacks to execute on success (link)
errbacks: Vec<CallbackSignature>Callbacks to execute on error (errback)
chain: Vec<CallbackSignature>Chain of tasks to execute after this one
chord: Option<CallbackSignature>Chord callback (executed after group completes)
group: Option<Uuid>Group ID
parent_id: Option<Uuid>Parent task ID
root_id: Option<Uuid>Root task ID
extra: HashMap<String, Value>Additional custom embed fields
Implementations§
Source§impl EmbedOptions
impl EmbedOptions
Sourcepub fn with_callback(self, callback: CallbackSignature) -> Self
pub fn with_callback(self, callback: CallbackSignature) -> Self
Add a success callback (link)
Sourcepub fn with_errback(self, errback: CallbackSignature) -> Self
pub fn with_errback(self, errback: CallbackSignature) -> Self
Add an error callback (errback)
Sourcepub fn with_chain_task(self, task: CallbackSignature) -> Self
pub fn with_chain_task(self, task: CallbackSignature) -> Self
Add a chain task
Sourcepub fn with_chord(self, chord: CallbackSignature) -> Self
pub fn with_chord(self, chord: CallbackSignature) -> Self
Set the chord callback
Sourcepub fn with_group(self, group: Uuid) -> Self
pub fn with_group(self, group: Uuid) -> Self
Set the group ID
Sourcepub fn with_parent(self, parent_id: Uuid) -> Self
pub fn with_parent(self, parent_id: Uuid) -> Self
Set the parent task ID
Sourcepub fn has_callbacks(&self) -> bool
pub fn has_callbacks(&self) -> bool
Check if there are any callbacks
Sourcepub fn has_errbacks(&self) -> bool
pub fn has_errbacks(&self) -> bool
Check if there are any errbacks
Sourcepub fn has_workflow(&self) -> bool
pub fn has_workflow(&self) -> bool
Check if this has any workflow elements
Trait Implementations§
Source§impl Clone for EmbedOptions
impl Clone for EmbedOptions
Source§fn clone(&self) -> EmbedOptions
fn clone(&self) -> EmbedOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmbedOptions
impl Debug for EmbedOptions
Source§impl Default for EmbedOptions
impl Default for EmbedOptions
Source§fn default() -> EmbedOptions
fn default() -> EmbedOptions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EmbedOptions
impl<'de> Deserialize<'de> for EmbedOptions
Source§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
Auto Trait Implementations§
impl Freeze for EmbedOptions
impl RefUnwindSafe for EmbedOptions
impl Send for EmbedOptions
impl Sync for EmbedOptions
impl Unpin for EmbedOptions
impl UnwindSafe for EmbedOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more