pub struct EmbeddedBody {
pub args: Vec<Value>,
pub kwargs: HashMap<String, Value>,
pub embed: EmbedOptions,
}Expand description
Complete embedded body format [args, kwargs, embed]
Fields§
§args: Vec<Value>Positional arguments
kwargs: HashMap<String, Value>Keyword arguments
embed: EmbedOptionsEmbed options
Implementations§
Source§impl EmbeddedBody
impl EmbeddedBody
Sourcepub fn with_kwargs(self, kwargs: HashMap<String, Value>) -> Self
pub fn with_kwargs(self, kwargs: HashMap<String, Value>) -> Self
Set keyword arguments
Sourcepub fn with_kwarg(self, key: impl Into<String>, value: Value) -> Self
pub fn with_kwarg(self, key: impl Into<String>, value: Value) -> Self
Add a keyword argument
Sourcepub fn with_embed(self, embed: EmbedOptions) -> Self
pub fn with_embed(self, embed: EmbedOptions) -> Self
Set embed options
Sourcepub fn with_callback(self, callback: CallbackSignature) -> Self
pub fn with_callback(self, callback: CallbackSignature) -> Self
Add a success callback
Sourcepub fn with_errback(self, errback: CallbackSignature) -> Self
pub fn with_errback(self, errback: CallbackSignature) -> Self
Add an error callback
Sourcepub fn to_json_string(&self) -> Result<String, Error>
pub fn to_json_string(&self) -> Result<String, Error>
Encode to JSON string
Sourcepub fn from_json_string(s: &str) -> Result<Self, Error>
pub fn from_json_string(s: &str) -> Result<Self, Error>
Decode from JSON string
Trait Implementations§
Source§impl Clone for EmbeddedBody
impl Clone for EmbeddedBody
Source§fn clone(&self) -> EmbeddedBody
fn clone(&self) -> EmbeddedBody
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 EmbeddedBody
impl Debug for EmbeddedBody
Source§impl Default for EmbeddedBody
impl Default for EmbeddedBody
Source§fn default() -> EmbeddedBody
fn default() -> EmbeddedBody
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EmbeddedBody
impl RefUnwindSafe for EmbeddedBody
impl Send for EmbeddedBody
impl Sync for EmbeddedBody
impl Unpin for EmbeddedBody
impl UnwindSafe for EmbeddedBody
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