pub struct ActivationTrigger {
pub key: ActivationTriggerKey,
pub name: String,
pub description: String,
}Expand description
Valid Activation Triggers for an Order.
Fields§
§key: ActivationTriggerKeyThe Activation Trigger Key
NOTE: This is what you with your orders.
name: StringName of the Activation Trigger.
description: StringDescription of the Activation Trigger.
Implementations§
Source§impl ActivationTrigger
impl ActivationTrigger
Sourcepub async fn fetch(client: &mut Client) -> Result<Vec<ActivationTrigger>, Error>
pub async fn fetch(client: &mut Client) -> Result<Vec<ActivationTrigger>, Error>
Fetch Activation Triggers for Order Execution.
NOTE: This provides the key that must be sent with an
order to utilize and be triggered by the activation function.
§Example
Fetch valid activation triggers to utilize with your orders.
ⓘ
use tradestation::{ClientBuilder, Error, Token};
#[tokio::main]
async fn main() -> Result<(), Error> {
// Initialize client
let mut client = ClientBuilder::new()?
.credentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")?
.token(Token {
access_token: String::from("YOUR_ACCESS_TOKEN"),
refresh_token: String::from("YOUR_REFRESH_TOKEN"),
id_token: String::from("YOUR_ID_TOKEN"),
token_type: String::from("Bearer"),
scope: String::from("YOUR_SCOPES SPACE_SEPERATED FOR_EACH_SCOPE"),
expires_in: 1200,
})?
.build()
.await?;
// Fetch a list of valid activation triggers for order execution.
let triggers = client.get_activation_triggers().await?;
println!("Valid activation triggers for order execution: {triggers:?}");
Ok(())
}Trait Implementations§
Source§impl Clone for ActivationTrigger
impl Clone for ActivationTrigger
Source§fn clone(&self) -> ActivationTrigger
fn clone(&self) -> ActivationTrigger
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 ActivationTrigger
impl Debug for ActivationTrigger
Source§impl<'de> Deserialize<'de> for ActivationTrigger
impl<'de> Deserialize<'de> for ActivationTrigger
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 ActivationTrigger
impl RefUnwindSafe for ActivationTrigger
impl Send for ActivationTrigger
impl Sync for ActivationTrigger
impl Unpin for ActivationTrigger
impl UnwindSafe for ActivationTrigger
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