pub struct Request {
pub command: String,
pub arguments: Option<Value>,
pub custom_tag: Option<String>,
}Expand description
Message sent to XTB servers
Fields§
§command: StringThe command name
arguments: Option<Value>Data (payload) send with a command
custom_tag: Option<String>Custom tag for message identification
Implementations§
Source§impl Request
impl Request
Sourcepub fn with_command(self, value: impl Into<String>) -> Self
pub fn with_command(self, value: impl Into<String>) -> Self
Sets the command field of this struct.
Sourcepub fn with_arguments(self, value: impl Into<Value>) -> Self
pub fn with_arguments(self, value: impl Into<Value>) -> Self
Sets the arguments field of this struct.
Sourcepub fn with_custom_tag(self, value: impl Into<String>) -> Self
pub fn with_custom_tag(self, value: impl Into<String>) -> Self
Sets the custom_tag field of this struct.
Source§impl Request
impl Request
Sourcepub fn with_maybe_arguments(self, arguments: Option<Value>) -> Self
pub fn with_maybe_arguments(self, arguments: Option<Value>) -> Self
Correctly set arguments.
The arguments can be:
- None - set payload to None
- Some(Value::Null) - set payload to None
- Some(Value::Object) - set payload to given value
§Panics
Any other payload configuration than supported one
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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