pub struct TradeContext { /* private fields */ }Expand description
Trade context
Implementations§
Source§impl TradeContext
impl TradeContext
Sourcepub async fn try_new(
config: Arc<Config>,
) -> Result<(Self, UnboundedReceiver<PushEvent>)>
pub async fn try_new( config: Arc<Config>, ) -> Result<(Self, UnboundedReceiver<PushEvent>)>
Create a TradeContext
Sourcepub async fn subscribe<I>(&self, topics: I) -> Result<()>where
I: IntoIterator<Item = TopicType>,
pub async fn subscribe<I>(&self, topics: I) -> Result<()>where
I: IntoIterator<Item = TopicType>,
Subscribe
Reference: https://open.longportapp.com/en/docs/trade/trade-push#subscribe
Sourcepub async fn unsubscribe<I>(&self, topics: I) -> Result<()>where
I: IntoIterator<Item = TopicType>,
pub async fn unsubscribe<I>(&self, topics: I) -> Result<()>where
I: IntoIterator<Item = TopicType>,
Unsubscribe
Reference: https://open.longportapp.com/en/docs/trade/trade-push#cancel-subscribe
Trait Implementations§
Source§impl Clone for TradeContext
impl Clone for TradeContext
Source§fn clone(&self) -> TradeContext
fn clone(&self) -> TradeContext
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 moreAuto Trait Implementations§
impl Freeze for TradeContext
impl RefUnwindSafe for TradeContext
impl Send for TradeContext
impl Sync for TradeContext
impl Unpin for TradeContext
impl UnwindSafe for TradeContext
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